method

*_previously_changed?

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActiveModel::Dirty
*_previously_changed? public

This method is generated for each attribute.

Returns true if the attribute previously had unsaved changes.

person = Person.new
person.name = 'Britanny'
person.save
person.name_previously_changed? # => true
person.name_previously_changed?(from: nil, to: 'Britanny') # => true
Show source
Register or log in to add new notes.