File versioning in Ruby on Rails with Paperclip & acts_as_versioned

July 23, 2009

This short tutorial shows you how to manage file versioning in Ruby on Rails by making Paperclip falling in love with acts_as_versioned. Paperclip & acts_as_versioned are plug-ins for Ruby on Rails: Paperclip manages file upload, acts_as_versioned enables models versioning.

Patch Paperclip

I patched Paperclip to keep old files when a new revision is saved. A fork of Paperclip adding the option keep_old_files to make Paperclip working with acts_as_versioned is available here: http://github.com/pcreux/paperclip/tree/master. You can install it running: