fix: correct handling of watermark attachment check

- Change return condition in add_watermark method from
  'return' to 'nil'.
- Ensure that the method correctly acknowledges the
  presence of an existing watermark image, allowing for
  further processing if necessary.

This change improves the clarity and functionality of the
add_watermark method by explicitly indicating when no
further action should be taken.
This commit is contained in:
songtianlun 2025-02-05 14:57:28 +08:00
parent ba8957e444
commit b97ac8b91d

View File

@ -16,7 +16,7 @@ class AddWatermarkToWeatherArtWorker
attr_reader :weather_art attr_reader :weather_art
def add_watermark def add_watermark
return if weather_art.image_with_watermark.attached? nil if weather_art.image_with_watermark.attached?
# watermark_path = Rails.root.join("app/assets/images/today_ai_weather_copyright_watermark1.png") # watermark_path = Rails.root.join("app/assets/images/today_ai_weather_copyright_watermark1.png")
# return unless File.exist?(watermark_path) # return unless File.exist?(watermark_path)