Skip to content

Instantly share code, notes, and snippets.

@dt1973
Created April 6, 2015 21:01
Show Gist options
  • Save dt1973/ed2dd2cf0307c7a26f36 to your computer and use it in GitHub Desktop.
Save dt1973/ed2dd2cf0307c7a26f36 to your computer and use it in GitHub Desktop.

The way DelayedJob works is, it serializes the model, sticks it into the db … till it can be processed. Then it re-marshals it … but this process is fragile.

For example, this bit in the is_animated_gif? method: attachment.queued_for_write[:original]

… that “queued_for_write” … Paperclip stores the uploaded image in a Tmpfile until it gets uploaded to S3. This is not something that could be serialized. The Tmpfile is probably deleted before the DelayedJob runs. Also, I remember during one Paperclip upgrade, they broke that method … I don’t think it works the same way in newer versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment