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"] }
# File activemodel/lib/active_model/dirty.rb, line 234 def changes cache_changed_attributes do ActiveSupport::HashWithIndifferentAccess[changed.map { |attr| [attr, attribute_change(attr)] }] end end