Module: ChronoModel::TimeMachine::ClassMethods
- Defined in:
- lib/chrono_model/time_machine.rb
Instance Method Summary collapse
- #attribute_names_for_history_changes ⇒ Object
- #has_timeline(options) ⇒ Object
-
#history? ⇒ Boolean
Identify this class as the parent, non-history, class.
Instance Method Details
#attribute_names_for_history_changes ⇒ Object
98 99 100 101 |
# File 'lib/chrono_model/time_machine.rb', line 98 def attribute_names_for_history_changes @attribute_names_for_history_changes ||= attribute_names - %w[id hid validity recorded_at] end |
#has_timeline(options) ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/chrono_model/time_machine.rb', line 103 def has_timeline() changes = .delete(:changes) assocs = history.has_timeline() attributes = if changes.present? Array.wrap(changes) else assocs.map(&:name) end attribute_names_for_history_changes.concat(attributes.map(&:to_s)) end |
#history? ⇒ Boolean
Identify this class as the parent, non-history, class.
90 91 92 |
# File 'lib/chrono_model/time_machine.rb', line 90 def history? false end |