Method: MongoODM::Document::AttributeMethods::ClassMethods#default_attributes
- Defined in:
- lib/mongo_odm/document/attribute_methods.rb
#default_attributes ⇒ Object
94 95 96 |
# File 'lib/mongo_odm/document/attribute_methods.rb', line 94 def default_attributes HashWithIndifferentAccess[fields.values.map{|field| [field.name, field.default.respond_to?(:call) ? field.default.call : field.default]}] end |