I have a model which has a paperclip attachment call spreadsheet.
The model is import which imports a spreadsheet data into the database.
I want to setup a task may be a rake task to clean up all the old imports (let's say older than 1 month).
I am not sure if this is the best way but this is what I found while searching.
The actual question is, when I destroy the model from a rake task, it doesn't delete the file from the system which is associated with the attachment. On the other hand, when I destroy the model from within the web application it destroys it.
What should I do to remove the attachment files along with destroying the model from a rake task ?