instance method
changes
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
changes()
Map of changed attrs => [original value, new value].
person.changes # => {} person.name = 'bob' person.changes # => { 'name' => ['bill', 'bob'] }
Source
# File activerecord/lib/active_record/dirty.rb, line 73
def changes
changed.inject({}) { |h, attr| h[attr] = attribute_change(attr); h }
end
Defined in activerecord/lib/active_record/dirty.rb line 73
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Dirty