Module: Mongoid::Relations
- Extended by:
- ActiveSupport::Concern
- Includes:
- Accessors, AutoSave, Builders, Cascading, Cyclic, Macros, Polymorphic, Reflections
- Included in:
- Components
- Defined in:
- lib/mongoid/relations.rb,
lib/mongoid/relations/one.rb,
lib/mongoid/relations/many.rb,
lib/mongoid/relations/proxy.rb,
lib/mongoid/relations/cyclic.rb,
lib/mongoid/relations/macros.rb,
lib/mongoid/relations/binding.rb,
lib/mongoid/relations/builder.rb,
lib/mongoid/relations/builders.rb,
lib/mongoid/relations/metadata.rb,
lib/mongoid/relations/accessors.rb,
lib/mongoid/relations/auto_save.rb,
lib/mongoid/relations/cascading.rb,
lib/mongoid/relations/constraint.rb,
lib/mongoid/relations/embedded/in.rb,
lib/mongoid/relations/polymorphic.rb,
lib/mongoid/relations/reflections.rb,
lib/mongoid/relations/embedded/one.rb,
lib/mongoid/relations/embedded/many.rb,
lib/mongoid/relations/referenced/in.rb,
lib/mongoid/relations/nested_builder.rb,
lib/mongoid/relations/referenced/one.rb,
lib/mongoid/relations/embedded/atomic.rb,
lib/mongoid/relations/referenced/many.rb,
lib/mongoid/relations/cascading/delete.rb,
lib/mongoid/relations/referenced/batch.rb,
lib/mongoid/relations/cascading/destroy.rb,
lib/mongoid/relations/cascading/nullify.rb,
lib/mongoid/relations/cascading/strategy.rb,
lib/mongoid/relations/embedded/atomic/set.rb,
lib/mongoid/relations/bindings/embedded/in.rb,
lib/mongoid/relations/builders/embedded/in.rb,
lib/mongoid/relations/embedded/atomic/pull.rb,
lib/mongoid/relations/bindings/embedded/one.rb,
lib/mongoid/relations/builders/embedded/one.rb,
lib/mongoid/relations/embedded/atomic/unset.rb,
lib/mongoid/relations/bindings/embedded/many.rb,
lib/mongoid/relations/bindings/referenced/in.rb,
lib/mongoid/relations/builders/embedded/many.rb,
lib/mongoid/relations/builders/referenced/in.rb,
lib/mongoid/relations/bindings/referenced/one.rb,
lib/mongoid/relations/builders/referenced/one.rb,
lib/mongoid/relations/referenced/batch/insert.rb,
lib/mongoid/relations/referenced/many_to_many.rb,
lib/mongoid/relations/bindings/referenced/many.rb,
lib/mongoid/relations/builders/referenced/many.rb,
lib/mongoid/relations/embedded/atomic/push_all.rb,
lib/mongoid/relations/embedded/atomic/operation.rb,
lib/mongoid/relations/builders/nested_attributes/one.rb,
lib/mongoid/relations/builders/nested_attributes/many.rb,
lib/mongoid/relations/bindings/referenced/many_to_many.rb,
lib/mongoid/relations/builders/referenced/many_to_many.rb
Overview
:nodoc:
Defined Under Namespace
Modules: Accessors, AutoSave, Bindings, Builders, Cascading, Cyclic, Embedded, Macros, Polymorphic, Referenced, Reflections Classes: Binding, Builder, Constraint, Many, Metadata, NestedBuilder, One, Proxy
Instance Method Summary collapse
-
#embedded? ⇒ true, false
Determine if the document itself is embedded in another document via the proper channels.
-
#embedded_many? ⇒ true, false
Determine if the document is part of an embeds_many relation.
-
#embedded_one? ⇒ true, false
Determine if the document is part of an embeds_one relation.
-
#referenced_many? ⇒ true, false
Determine if the document is part of an references_many relation.
-
#referenced_one? ⇒ true, false
Determine if the document is part of an references_one relation.
Methods included from Cascading
Methods included from Accessors
#build, #create_relation, #options, #relation_exists?, #set, #substitute
Instance Method Details
#embedded? ⇒ true, false
Determine if the document itself is embedded in another document via the proper channels. (If it has a parent document.)
55 56 57 |
# File 'lib/mongoid/relations.rb', line 55 def cyclic ? _parent.present? : self.class. end |
#embedded_many? ⇒ true, false
Determine if the document is part of an embeds_many relation.
67 68 69 |
# File 'lib/mongoid/relations.rb', line 67 def && .macro == :embeds_many end |
#embedded_one? ⇒ true, false
Determine if the document is part of an embeds_one relation.
79 80 81 |
# File 'lib/mongoid/relations.rb', line 79 def && .macro == :embeds_one end |
#referenced_many? ⇒ true, false
Determine if the document is part of an references_many relation.
91 92 93 |
# File 'lib/mongoid/relations.rb', line 91 def referenced_many? && .macro == :references_many end |
#referenced_one? ⇒ true, false
Determine if the document is part of an references_one relation.
103 104 105 |
# File 'lib/mongoid/relations.rb', line 103 def referenced_one? && .macro == :references_one end |