Skip to content

acts_as_versionable for the newest_rails versions with dirty attributes handling

License

Notifications You must be signed in to change notification settings

xedin/acts_as_versionable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

acts_as_versionable for the newest_rails versions with dirty attributes handling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages