Module: Mongoid::Relations::Cyclic::ClassMethods
- Defined in:
- lib/mongoid/relations/cyclic.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#recursively_embeds_many ⇒ Object
Create a cyclic embedded relation that creates a tree hierarchy for the document and many embedded child documents.
-
#recursively_embeds_one ⇒ Object
Create a cyclic embedded relation that creates a single self referencing relationship for a parent and a single child.
Instance Method Details
#recursively_embeds_many ⇒ Object
Create a cyclic embedded relation that creates a tree hierarchy for the document and many embedded child documents.
This provides the default nomenclature for accessing a parent document or its children.
38 39 40 41 42 |
# File 'lib/mongoid/relations/cyclic.rb', line 38 def self.cyclic = true cyclic_child_name, :class_name => self.name, :cyclic => true cyclic_parent_name, :class_name => self.name, :cyclic => true end |
#recursively_embeds_one ⇒ Object
Create a cyclic embedded relation that creates a single self referencing relationship for a parent and a single child.
This provides the default nomenclature for accessing a parent document or its children.
66 67 68 69 70 |
# File 'lib/mongoid/relations/cyclic.rb', line 66 def self.cyclic = true cyclic_child_name(false), :class_name => self.name, :cyclic => true cyclic_parent_name, :class_name => self.name, :cyclic => true end |