Class: Mongoid::Relations::One
- Defined in:
- lib/mongoid/relations/one.rb
Overview
This is the superclass for one to one relations and defines the common behaviour or those proxies.
Direct Known Subclasses
Embedded::In, Embedded::One, Referenced::In, Referenced::One
Instance Attribute Summary
Attributes inherited from Proxy
#base, #loaded, #metadata, #target
Instance Method Summary collapse
-
#in_memory ⇒ Array<Document>
Get all the documents in the relation that are loaded into memory.
-
#respond_to?(name, include_private = false) ⇒ true, false
Since method_missing is overridden we should override this as well.
Methods inherited from Proxy
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Mongoid::Relations::Proxy
Instance Method Details
#in_memory ⇒ Array<Document>
Get all the documents in the relation that are loaded into memory.
17 18 19 |
# File 'lib/mongoid/relations/one.rb', line 17 def in_memory [ target ] end |
#respond_to?(name, include_private = false) ⇒ true, false
Since method_missing is overridden we should override this as well.
31 32 33 |
# File 'lib/mongoid/relations/one.rb', line 31 def respond_to?(name, include_private = false) target.respond_to?(name, include_private) || super end |