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

Support only_process option to process_in_background #21

Closed jcbpl closed 11 years ago

jcbpl commented 11 years ago

Paperclip::Attachment.reprocess! doesn't use the only_process option set by has_attached_file.

By default, reprocess! will delete and rewrite every style, including :original, which is unnecessary if you're just creating thumbnails.

Includes passing test & readme update.

ScotterC commented 11 years ago

I had no idea that paperclips default action was to overwrite the original as well. I think I may have lost some images to this in the past.

jcbpl commented 11 years ago

Yeah, caught me off guard. I noticed that if the :path contained :updated_at, the location of the original file changed after processing.

An alternative to this solution would be to modify delayed_paperclip to use has_attached_file's only_process option; might be closer to the expected behavior.

Is there any way to re-run the travis build? It failed on bundle install.

ScotterC commented 11 years ago

Hmm I don't have rights to restart the job. @jrgifford can you hit restart on the actions for build 33.4?

jrgifford commented 11 years ago

Looking.

jrgifford commented 11 years ago

restarted, we'll know in a minute.

jrgifford commented 11 years ago

Looks good. :+1:

ScotterC commented 11 years ago

Wohoo!

jcbpl commented 11 years ago

Thanks!