acts_as_versioned

Developing with Ruby on Rails is wonderful. I had been dreading implementing versioned objects, which are needed if I want to introduce publicly editable fields. But after a bit of googling I found the acts_as_versioned plugin that does it all for you in one line of code!

Amazing!

class Page < ActiveRecord::Base
  acts_as_versioned
end

The acts_as_versioned at the top of the model class is all that’s needed. It’s so simple it makes you wonder what the catch is, except there is no catch.