instance method
changes
Ruby on Rails edge
Since v3.0.20Signature
changes()
Returns a hash of changed attributes indicating their original
and new values like `attr => [original value, new value]`.
```
person.changes # => {}
person.name = 'bob'
person.changes # => { "name" => ["bill", "bob"] }
```
Source
# File activemodel/lib/active_model/dirty.rb, line 410
def changes
mutations_from_database.changes
end
Defined in activemodel/lib/active_model/dirty.rb line 410
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Dirty