Module: TrackHistory::ActsAsMethods
- Defined in:
- lib/track_history.rb
Instance Method Summary collapse
- #historical_class ⇒ Object
-
#track_history(options = {}, &block) ⇒ Object
Make a model historical Takes a hash of options, which can only be :model_name to force a different model name Default model name is ModelHistory.
Instance Method Details
#historical_class ⇒ Object
37 38 39 |
# File 'lib/track_history.rb', line 37 def historical_class @klass_reference end |
#track_history(options = {}, &block) ⇒ Object
Make a model historical Takes a hash of options, which can only be :model_name to force a different model name Default model name is ModelHistory
32 33 34 35 |
# File 'lib/track_history.rb', line 32 def track_history( = {}, &block) .assert_valid_keys(:model_name, :table_name, :reference) define_historical_model(self, [:model_name], [:table_name], .has_key?(:reference) ? !![:reference] : true, &block) end |