Module: TrackHistory::HistoricalRelationHelpers
- Defined in:
- lib/track_history/historical_relation_helpers.rb
Instance Method Summary collapse
-
#modifications ⇒ Object
Get a list of the modifications in a given history.
- #to_s ⇒ Object
Instance Method Details
#modifications ⇒ Object
Get a list of the modifications in a given history
6 7 8 9 10 |
# File 'lib/track_history/historical_relation_helpers.rb', line 6 def modifications self.class.historical_fields.reject do |field, | send([:before]) == send([:after]) end.keys end |
#to_s ⇒ Object
12 13 14 15 16 17 |
# File 'lib/track_history/historical_relation_helpers.rb', line 12 def to_s return 'modified nothing' if modifications.empty? str = 'modified ' + modifications.sort.join(', ') str += " on #{historical_relation}" if self.class.instance_variable_get(:@track_historical_reference) str end |