Class: Mongoid::Relations::Builders::Embedded::In
- Inherits:
-
Mongoid::Relations::Builder
- Object
- Mongoid::Relations::Builder
- Mongoid::Relations::Builders::Embedded::In
- Defined in:
- lib/mongoid/relations/builders/embedded/in.rb
Overview
Instance Attribute Summary
Attributes inherited from Mongoid::Relations::Builder
Instance Method Summary collapse
-
#build(type = nil) ⇒ Document
This builder doesn’t actually build anything, just returns the parent since it should already be instantiated.
Methods inherited from Mongoid::Relations::Builder
Constructor Details
This class inherits a constructor from Mongoid::Relations::Builder
Instance Method Details
#build(type = nil) ⇒ Document
This builder doesn’t actually build anything, just returns the parent since it should already be instantiated.
17 18 19 20 21 22 23 24 |
# File 'lib/mongoid/relations/builders/embedded/in.rb', line 17 def build(type = nil) return object unless object.is_a?(Hash) if _loading? Factory.from_db(klass, object) else Factory.build(klass, object) end end |