lib/mongoid/changeable.rb
# Call this method after save, so the changes can be properly switched.
#
# This will unset the memoized children array, set new record to
# false, set the document as validated, and move the dirty changes.
#
# @example Move the changes to previous.
#   person.move_changes
Call this method after save, so the changes can be properly switched.
This will unset the memoized children array, set new record to
false, set the document as validated, and move the dirty changes.
Call this method after save so the changes can be properly switched . This will unset the memoized children array set new record to false set the document as validated and move the dirty changes .
def move_changes
      @previous_changes = changes
      @previous_attributes = attributes.dup
      Atomic::UPDATES.each do |update|
        send(update).clear
      end
      changed_attributes.clear
    end
def move_changes @previous_changes = changes @previous_attributes = attributes . dup Atomic :: UPDATES . each do | update | send ( update ) . clear end changed_attributes . clear end
Call this method after save, so the changes can be properly switched.
Call this method after save so the changes can be properly switched .
example
Move the changes to previous. person.move_changes
Move the changes to previous . person . move_changes