Displaying 1 result from an estimated 1 matches for "restore_attachment".
2012 Jan 25
0
Paperclip preserve files ?
...ould be deleted from db but the file need to be restored.
I am using the option :preserve_files => true.
If I keep the above option in model it will be access to all the
objects of the model. I need to restore only for limited objects.
for example
def destroy
if obj.restore_attachment
Paperclip::Attachment.default_options.merge!(:preserve_files
=>true)
end
Paperclip::Attachment.default_options.merge!(:preserve_files
=>false)
obj.destroy
end
If you observe depending on the attachment property I am setting
the option.
obj.re...