thoughtbot/paperclip — Issue #694: Marshal Dump and session problems
Author: YavorIvanov
Created: 2012-01-04 09:48:05+00:00
State: open

Hi,

I found a weird case in a Rails 2.3.12 app that causes trouble.
Basically the clear method doesn't work as expected in newest version of paperclip.

Paperclip 2.3.8 behaves differently and does not give the same issue as the 2.4.x branch.

There is a case where you might want to pass your object via flash/session and 2.4.x doesn't clear the attachments so basically you put them into the session and a Marshal Dump error occurs.

Here is an example code from the app that causes the problem under the newest version of the paperclip gem.

flash[:story] = @story
# don't send those to session
@story.image.queued_for_write.clear
@story.pic.queued_for_write.clear
@story.image_file = nil

The solution for now is to downgrade if you have such need in your app.

Best regards,
Yavor