Module: TrackChanges::ClassMethods
- Defined in:
- lib/track_changes/track_changes.rb
Instance Method Summary collapse
-
#track_changes_fields ⇒ Object
Returns the method names to call to fetch the fields tracked for changes.
Instance Method Details
#track_changes_fields ⇒ Object
Returns the method names to call to fetch the fields tracked for changes
22 23 24 25 26 27 28 |
# File 'lib/track_changes/track_changes.rb', line 22 def track_changes_fields fields = Array([:only]).collect(&:to_s).presence || self.attribute_names fields -= Array([:except]).collect(&:to_s) fields += Array([:methods]).collect(&:to_s) fields -= ['created_at', 'updated_at'] unless [:track_timestamps] fields -= [primary_key] unless [:track_primary_key] end |