Module: ModelsTimeline::ModelAdditions
- Defined in:
- lib/models_timeline/model_additions.rb
Class Method Summary collapse
-
.extended(obj) ⇒ Object
:nodoc.
Instance Method Summary collapse
-
#timeline(*attrs) ⇒ Object
To track your model changes call
timeline
in any Active Record model class.
Class Method Details
.extended(obj) ⇒ Object
:nodoc
3 4 5 |
# File 'lib/models_timeline/model_additions.rb', line 3 def self.extended(obj) #:nodoc obj.send :include, ClassMethods end |
Instance Method Details
#timeline(*attrs) ⇒ Object
To track your model changes call timeline
in any Active Record model class.
class Product < ActiveRecord::Base
timeline
end
To track only one or a set of attributes(columns) call timeline :attr1, :attr2
.
class Product < ActiveRecord::Base
timeline :price, :description
end
20 21 22 |
# File 'lib/models_timeline/model_additions.rb', line 20 def timeline(*attrs) track(attrs) end |