Class: Mongoid::History::Attributes::Update

Inherits:
Base
  • Object
show all
Defined in:
lib/mongoid/history/attributes/update.rb

Instance Attribute Summary

Attributes inherited from Base

#trackable

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Mongoid::History::Attributes::Base

Instance Method Details

#attributesHash<String, Array<(?,?)>>

Returns Hash of changes.

Examples:

when both an attribute ‘foo` and a child’s attribute ‘nested_bar.baz` are changed


{
  'foo' => ['foo_before_changes', 'foo_after_changes']
  'nested_bar.baz' => ['nested_bar_baz_before_changes', 'nested_bar_baz_after_changes']
  }
}

Returns:

  • (Hash<String, Array<(?,?)>>)

    Hash of changes



14
15
16
# File 'lib/mongoid/history/attributes/update.rb', line 14

def attributes
  changes_from_parent.deep_merge(changes_from_children)
end