method
previous_changes
v4.2.1 -
Show latest stable
- Class:
ActiveModel::Dirty
previous_changes()public
Returns a hash of attributes that were changed before the model was saved.
person.name # => "bob" person.name = 'robert' person.save person.previous_changes # => {"name" => ["bob", "robert"]}