Paperclip attachment destroy

Hi all

I’ve got a problem with the paperclip-plugin.
Is it posible that the attachment is not destroy if i call the
destroy-
method of a model?
Thank you for your help!

sigma

Hi
Has nobody an idea how this could work?

sigma

Christoph Thommen wrote:

Hi
Has nobody an idea how this could work?

sigma

Hi sigma

I haven’t noticed this. You may want to post in the Paperclip google
group to see what they say. If you’re really worried, maybe you could do
a before_destroy callback on the model and set its attachment attribute
to nil (or call @model.attachment.destroy) - that should do the trick.
But I bet that the attachment probably is being destroyed, I would’ve
thought it should be default behaviour by Paperclip…

(or call @model.attachment.destroy) - that should do the trick.

Doesn’t work.

Colorblind wrote:

(or call @model.attachment.destroy) - that should do the trick.

Doesn’t work.

@model.destroy will destroy both the object and file from your storage
system. If it does not, it means you have customized somewhere the
behavior of the attachment. Using debugger should help you out and check
out thoroughly your log files.