Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1019 Bytes

README.rdoc

File metadata and controls

35 lines (23 loc) · 1019 Bytes

Acts As Versionable

Why?

Since I found no good plugins/gems I decided to write my own.

 * acts_as_versioned does not support current rails with dirty attribute handling
 * version_fu does not provide easy to use sintax

Goals?

* Tracking the versions.
* Applying diffs to the versions of to the specific instances of the model.
* Reverting bitween versions.
* Will give you possibility track changes on only required fields of your model.

Installation

Simply run `script/plugin install git://github.com/xedin/acts_as_versionable.git`

Example

article = Article.create(:title => 'title', :body => 'body')
article.version => 1

article.title = 'new title'
article.save => true
article.version => 2
article.versions => Array(2)
article.revert_to(1) => #<Article ...>

article.diff_with_version(2) # diff between versions is possible
article.diff(Article.new(:title => ...)) # diff by instance

Copyright © 2009 Pavel Yaskevich, released under the MIT license