instance method
changes
Ruby on Rails 3.0.20
Since v3.0.20Signature
changes()
Map of changed attrs => [original value, new value].
person.changes # => {} person.name = 'bob' person.changes # => { 'name' => ['bill', 'bob'] }
Source
# File activemodel/lib/active_model/dirty.rb, line 117
def changes
changed.inject(HashWithIndifferentAccess.new){ |h, attr| h[attr] = attribute_change(attr); h }
end
Defined in activemodel/lib/active_model/dirty.rb line 117
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Dirty