Module: Mongoid::Fields::Serializable::ClassMethods
- Defined in:
- lib/mongoid/fields/serializable.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#instantiate(name, options = {}) ⇒ Object
Create the new field with a name and optional additional options.
Instance Method Details
#instantiate(name, options = {}) ⇒ Object
Create the new field with a name and optional additional options.
171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/mongoid/fields/serializable.rb', line 171 def instantiate(name, = {}) allocate.tap do |field| field.name = name field. = field.label = [:label] field.localize = [:localize] field.default_val = [:default] unless field.default_val field.default_val = {} if field.localized? end end end |