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, criteria = nil, selected_fields = nil) ⇒ Object (also: #from_db)
Instance Method Details
#from_db_with_custom_fields(klass, attributes = nil, criteria = nil, selected_fields = nil) ⇒ Object Also known as: from_db
6 7 8 9 10 |
# File 'lib/custom_fields/extensions/mongoid/factory.rb', line 6 def from_db_with_custom_fields(klass, attributes = nil, criteria = nil, selected_fields = nil) klass.klass_with_custom_fields(attributes['custom_fields_recipe']) if klass.with_custom_fields? from_db_without_custom_fields(klass, attributes, criteria, selected_fields) end |