Module: Mobility::Plugins::ActiveRecord::Dirty::InstanceMethods
- Defined in:
- lib/mobility/plugins/active_record/dirty.rb
Instance Method Summary collapse
- #attributes_in_database ⇒ Object
- #changed_attribute_names_to_save ⇒ Object
- #changes_to_save ⇒ Object
- #has_changes_to_save? ⇒ Boolean
- #reload ⇒ Object
- #saved_changes ⇒ Object
Instance Method Details
#attributes_in_database ⇒ Object
94 95 96 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 94 def attributes_in_database super.merge(mutations_from_mobility.changed_attributes) end |
#changed_attribute_names_to_save ⇒ Object
90 91 92 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 90 def changed_attribute_names_to_save super + mutations_from_mobility.changed end |
#changes_to_save ⇒ Object
86 87 88 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 86 def changes_to_save super.merge(mutations_from_mobility.changes) end |
#has_changes_to_save? ⇒ Boolean
98 99 100 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 98 def has_changes_to_save? super || mutations_from_mobility.changed? end |
#reload ⇒ Object
102 103 104 105 106 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 102 def reload(*) super.tap do @mutations_from_mobility = nil end end |
#saved_changes ⇒ Object
82 83 84 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 82 def saved_changes super.merge(mutations_from_mobility.previous_changes) end |