Track attributes changes in AR models
Add this line to your application's Gemfile:
gem 'attr_trackable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install attr_trackable
For example if You want to track first_name and last_name attributes of Your model
class Person < ActiveRecord::Base
attr_trackable :first_name, :last_name
end
To fetch changes
Person.changes_history :first_name
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request