Method: Dynamoid::Dirty#previous_changes
- Defined in:
- lib/dynamoid/dirty.rb
#previous_changes ⇒ Object
Returns a hash of attributes that were changed before the model was saved.
person.name # => "bob"
person.name = 'robert'
person.save
person.previous_changes # => {"name" => ["bob", "robert"]}
112 113 114 |
# File 'lib/dynamoid/dirty.rb', line 112 def previous_changes @previously_changed ||= ActiveSupport::HashWithIndifferentAccess.new end |