Module: Mobility::Plugins::ActiveModel::Dirty::InstanceMethods
- Defined in:
- lib/mobility/plugins/active_model/dirty.rb
Instance Method Summary collapse
- #changed ⇒ Object
- #changed? ⇒ Boolean
- #changed_attributes ⇒ Object
- #changes ⇒ Object
- #changes_applied ⇒ Object
- #clear_attribute_changes(attr_names) ⇒ Object
- #clear_changes_information ⇒ Object
- #previous_changes ⇒ Object
Instance Method Details
#changed ⇒ Object
205 206 207 208 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 205 def changed # uniq is required for Rails < 6.0 (super + mutations_from_mobility.changed).uniq end |
#changed? ⇒ Boolean
210 211 212 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 210 def changed? super || mutations_from_mobility.changed? end |
#changed_attributes ⇒ Object
192 193 194 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 192 def changed_attributes super.merge(mutations_from_mobility.changed_attributes) end |
#changes ⇒ Object
201 202 203 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 201 def changes super.merge(mutations_from_mobility.changes) end |
#changes_applied ⇒ Object
196 197 198 199 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 196 def changes_applied super mutations_from_mobility.finalize_changes end |
#clear_attribute_changes(attr_names) ⇒ Object
223 224 225 226 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 223 def clear_attribute_changes(attr_names) attr_names.each { |attr_name| mutations_from_mobility.restore_attribute!(attr_name) } super end |
#clear_changes_information ⇒ Object
218 219 220 221 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 218 def clear_changes_information @mutations_from_mobility = nil super end |
#previous_changes ⇒ Object
214 215 216 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 214 def previous_changes super.merge(mutations_from_mobility.previous_changes) end |