Method: Dynamoid::Dirty#attribute_previous_change
- Defined in:
- lib/dynamoid/dirty.rb
#attribute_previous_change(name) ⇒ Array
Handles *_previous_change for method_missing.
person = Person.create(name: 'Alice')
person.name = 'Bob'
person.save
person.attribute_previously_changed(:name) # => ["Alice", "Bob"]
227 228 229 |
# File 'lib/dynamoid/dirty.rb', line 227 def attribute_previous_change(name) previous_changes[name] if attribute_previously_changed?(name) end |