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
95 96 97 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 95 def attributes_in_database super.merge(mutations_from_mobility.changed_attributes) end |
#changed_attribute_names_to_save ⇒ Object
91 92 93 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 91 def changed_attribute_names_to_save super + mutations_from_mobility.changed end |
#changes_to_save ⇒ Object
87 88 89 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 87 def changes_to_save super.merge(mutations_from_mobility.changes) end |
#has_changes_to_save? ⇒ Boolean
100 101 102 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 100 def has_changes_to_save? super || mutations_from_mobility.changed? end |
#reload ⇒ Object
106 107 108 109 110 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 106 def reload(*) super.tap do @mutations_from_mobility = nil end end |
#saved_changes ⇒ Object
83 84 85 |
# File 'lib/mobility/plugins/active_record/dirty.rb', line 83 def saved_changes super.merge(mutations_from_mobility.previous_changes) end |