module ActiveModel::Dirty

def changes_applied # :doc:

:doc:
Removes current changes and makes them accessible through +previous_changes+.
def changes_applied # :doc:
  @previously_changed = changes
  @changed_attributes = ActiveSupport::HashWithIndifferentAccess.new
end