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
197 198 199 200 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 197 def changed # uniq is required for Rails < 6.0 (super + mutations_from_mobility.changed).uniq end |
#changed? ⇒ Boolean
202 203 204 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 202 def changed? super || mutations_from_mobility.changed? end |
#changed_attributes ⇒ Object
184 185 186 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 184 def changed_attributes super.merge(mutations_from_mobility.changed_attributes) end |
#changes ⇒ Object
193 194 195 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 193 def changes super.merge(mutations_from_mobility.changes) end |
#changes_applied ⇒ Object
188 189 190 191 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 188 def changes_applied super mutations_from_mobility.finalize_changes end |
#clear_attribute_changes(attr_names) ⇒ Object
215 216 217 218 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 215 def clear_attribute_changes(attr_names) attr_names.each { |attr_name| mutations_from_mobility.restore_attribute!(attr_name) } super end |
#clear_changes_information ⇒ Object
210 211 212 213 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 210 def clear_changes_information @mutations_from_mobility = nil super end |
#previous_changes ⇒ Object
206 207 208 |
# File 'lib/mobility/plugins/active_model/dirty.rb', line 206 def previous_changes super.merge(mutations_from_mobility.previous_changes) end |