Method: Mongoid::Fields#apply_pre_processed_defaults

Defined in:
lib/mongoid/fields.rb

#apply_pre_processed_defaultsArray<String>

Apply all default values to the document which are not procs.

Examples:

Apply all the non-proc defaults.

model.apply_pre_processed_defaults

Returns:

  • (Array<String>)

    The names of the non-proc defaults.



158
159
160
161
162
# File 'lib/mongoid/fields.rb', line 158

def apply_pre_processed_defaults
  pre_processed_defaults.each do |name|
    apply_default(name)
  end
end