Module: Mongoid::Factory
- Defined in:
- lib/custom_fields/extensions/mongoid/factory.rb
Overview
Instantiates documents that came from the database.
Instance Method Summary collapse
- #from_db_with_custom_fields(klass, attributes = nil, selected_fields = nil) ⇒ Object (also: #from_db)
Instance Method Details
#from_db_with_custom_fields(klass, attributes = nil, selected_fields = nil) ⇒ Object Also known as: from_db
6 7 8 9 10 11 12 |
# File 'lib/custom_fields/extensions/mongoid/factory.rb', line 6 def from_db_with_custom_fields(klass, attributes = nil, selected_fields = nil) if klass.with_custom_fields? klass.klass_with_custom_fields(attributes['custom_fields_recipe']) end from_db_without_custom_fields(klass, attributes, selected_fields) end |