jrgifford / delayed_paperclip

Process your Paperclip attachments in the background with delayed_job or Resque.
http://www.jstorimer.com/ruby/2010/01/30/delayed-paperclip.html
MIT License
402 stars 155 forks source link

Avoid creating jobs when nothing to process #218

Open ghost opened 6 years ago

ghost commented 6 years ago

I've this line in my model

process_in_background :file, only_process: ->(attachment) { attachment.instance.file_styles_to_process_background }

And sometimes, file_styles_to_process_background has the value of []. When this happen, the gem is still creating the delayed jobs.

Could this gem support this behaviour and avoid creating jobs in this case?

I'm asking that because it seems to me when a job is created it will copy the distant to local.