Fork of technoweenie’s acts_as_versioned gem. My fork just adds a serialized ‘changes’ column to the versioned table which you can use do show the changes that were made in this version against the original eg:
<% version.changes.each_pair do |key,values| >
Field: <= key >
Original: <= values.first >
Updated: <= value.last >
< end %>
- cd vendor/gems
- git clone git://github.com/gordonbisnor/acts_as_versioned_with_changes.git
- Add a migration:
class VersionTable > ActiveRecord::Migration
def self.up
Article.create_versioned_table
end
def self.down
Article.drop_versioned_table
end
end - In your model:
class Article > ActiveRecord::Base
acts_as_versioned_with_changes
end
Same as acts_as_versioned, just adds a serialized changes column if you need a hash to indicate the changes made from one version to the next.