Method: Mongoid::Dirty::InstanceMethods#changes

Defined in:
lib/mongoid/dirty.rb

#changesObject

Gets all the modifications that have happened to the object as a Hash with the keys being the names of the fields, and the values being an Array with the old value and new value.

Example:

person = Person.new(:title => "Sir")
person.title = "Madam"
person.changes # returns { "title" => [ "Sir", "Madam" ] }

Returns:

A Hash of changes.



95
96
97
# File 'lib/mongoid/dirty.rb', line 95

def changes
  modifications
end