Join GitHub today
Paperclip + Permanent records #804
What you could do is override
(Don't return false, as it will halt the chain)
You can see that Paperclip add the callback in https://github.com/thoughtbot/paperclip/blob/v3.0.1/lib/paperclip.rb#L182 which executes https://github.com/thoughtbot/paperclip/blob/v3.0.1/lib/paperclip/instance_methods.rb#L28-33.
def prepare_for_destroy true end def destroy(force = nil) if :force == force each_attachment do |name, attachment| attachment.send(:queue_existing_for_delete) end end super end
I did it in this way, because I do need files to be reoved when destroy is called with :force parametr. But I get an error
undefined method `queue_existing_for_delete' for #<Paperclip::Attachment:0xfc8cb34>
Can you help me please?