Class: ActiveRecord::Journal::Journable::Changes
- Inherits:
-
Struct
- Object
- Struct
- ActiveRecord::Journal::Journable::Changes
- Defined in:
- lib/active_record/journal/journable/changes.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#keys ⇒ Object
Returns the value of attribute keys.
-
#mask_keys ⇒ Object
Returns the value of attribute mask_keys.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
6 7 8 |
# File 'lib/active_record/journal/journable/changes.rb', line 6 def action @action end |
#keys ⇒ Object
Returns the value of attribute keys
6 7 8 |
# File 'lib/active_record/journal/journable/changes.rb', line 6 def keys @keys end |
#mask_keys ⇒ Object
Returns the value of attribute mask_keys
6 7 8 |
# File 'lib/active_record/journal/journable/changes.rb', line 6 def mask_keys @mask_keys end |
#subject ⇒ Object
Returns the value of attribute subject
6 7 8 |
# File 'lib/active_record/journal/journable/changes.rb', line 6 def subject @subject end |
Instance Method Details
#call ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/active_record/journal/journable/changes.rb', line 7 def call changes.each_with_object({}) do |(key, value), attrs| attrs[key] = value next unless mask_keys&.include?(key) attrs[key] = value.is_a?(Array) ? [nil, nil] : nil end end |