Method: Mongoid::Fields.option
- Defined in:
- lib/mongoid/fields.rb
.option(option_name, &block) ⇒ Object
Stores the provided block to be run when the option name specified is defined on a field.
No assumptions are made about what functionality the handler might perform, so it will always be called if the option_name key is provided in the field definition – even if it is false or nil.
298 299 300 |
# File 'lib/mongoid/fields.rb', line 298 def option(option_name, &block) [option_name] = block end |