Class: AttributesHistory::HistorySaver
- Inherits:
-
Object
- Object
- AttributesHistory::HistorySaver
- Defined in:
- lib/attributes_history/history_saver.rb
Instance Method Summary collapse
-
#initialize(changed_object, history_attributes, history_model) ⇒ HistorySaver
constructor
A new instance of HistorySaver.
- #save_if_needed ⇒ Object
Constructor Details
#initialize(changed_object, history_attributes, history_model) ⇒ HistorySaver
Returns a new instance of HistorySaver.
5 6 7 8 9 |
# File 'lib/attributes_history/history_saver.rb', line 5 def initialize(changed_object, history_attributes, history_model) @object = changed_object @history_attributes = history_attributes @history_model = history_model end |
Instance Method Details
#save_if_needed ⇒ Object
11 12 13 14 |
# File 'lib/attributes_history/history_saver.rb', line 11 def save_if_needed save_history_entry if ::AttributesHistory.enabled? && history_attributes_changed? end |