Method: Mongoid::Attributes#process_raw_attribute

Defined in:
lib/mongoid/attributes.rb

#process_raw_attribute(name, raw, field) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Process the raw attribute values just read from the documents attributes.

Parameters:

  • The name of the attribute to get.

  • The raw attribute value.

  • The field to use for demongoization or nil.

Returns:

  • The value of the attribute.

API:

  • private



105
106
107
108
109
# File 'lib/mongoid/attributes.rb', line 105

def process_raw_attribute(name, raw, field)
  value = field ? field.demongoize(raw) : raw
  attribute_will_change!(name) if value.resizable?
  value
end