How can I move deleting photos to the background with delayed_job and paperclip

Posted by Tam on Stack Overflow See other posts from Stack Overflow or by Tam
Published on 2011-01-13T05:49:50Z Indexed on 2011/01/13 5:53 UTC
Read the original article Hit count: 197

I let my users create photo albums with many photos. Relationship as follows:

has_many :album_photos, :dependent => :destroy

i upload photos to S3

When the user delete album I want to delete all photos as the relationship shows but it takes time if the user has many photos.

Can I automatically set photo deletion to happen in the background (delayed_job) without having to manually call 'send_later' on every photo?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about paperclip