Method: Mongoid::Changeable#changed

Defined in:
lib/mongoid/changeable.rb

#changedArray<String>

Get the changed attributes for the document.

Examples:

Get the changed attributes.

model.changed

Returns:

  • (Array<String>)

    The changed attributes.



14
15
16
# File 'lib/mongoid/changeable.rb', line 14

def changed
  changed_attributes.keys.select { |attr| attribute_change(attr) }
end