Class: Mongoid::History::Attributes::Create
- Defined in:
- lib/mongoid/history/attributes/create.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Mongoid::History::Attributes::Base
Instance Method Details
#attributes ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/mongoid/history/attributes/create.rb', line 5 def attributes @attributes = {} trackable.attributes.each do |k, v| next unless trackable_class.tracked_field?(k, :create) modified = if changes[k] changes[k].class == Array ? changes[k].last : changes[k] else v end @attributes[k] = [nil, format_field(k, modified)] end @attributes end |