Method: Dynamoid::Dirty#changes

Defined in:
lib/dynamoid/dirty.rb

#changesObject

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"] }


102
103
104
# File 'lib/dynamoid/dirty.rb', line 102

def changes
  ActiveSupport::HashWithIndifferentAccess[changed.map { |attr| [attr, attribute_change(attr)] }]
end