Skip to content

Latest commit

 

History

History
47 lines (28 loc) · 1.1 KB

README.rdoc

File metadata and controls

47 lines (28 loc) · 1.1 KB

TimeLine

Track the entire life cycle of ActiveRecord models.

Installation

Add the gem to your Gemfile

gem "models_timeline"

Copy some migration stuff:

rake models_timeline:install:migrations
rake db:migrate

Add to your route.rb file:

mount ModelsTimeline::Engine => "/models_timeline"

Requires Ruby 1.9.2 or later.

Usage

Call timeline in an ActiveRecord class and pass the name of the attributes you wish to track of your Model.

Track all attributes change of your AR model:

class Product < ActiveRecord::Base
  timeline
end

This means that every attributes changes will be tracked.

Track one or more attributes:

class Product < ActiveRecord::Base
  timeline(:price, :name)
end

Only the changes of name and price will be tracked.

To see the tracked changes go to:

http://domain:port/models_timeline

Development Questions or problems? Please post them on the issue tracker. You can contribute changes by forking the project and submitting a pull request. You can ensure the tests passing by running bundle and rake.

This gem is created by Angelo Capilleri and is under the MIT License.