Class: Mongoid::Association::Referenced::HasMany::Binding
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
|
|
Inherits: | Object |
Defined in: | lib/mongoid/association/referenced/has_many/binding.rb |
Overview
Binding
class for has_many associations.
Instance Attribute Summary
::Mongoid::Association::Bindable
- Included
::Mongoid::Threaded::Lifecycle
- Included
#_assigning | Begin the assignment of attributes. |
#_assigning? | Is the current thread in assigning mode? |
#_binding | Execute a block in binding mode. |
#_binding? | Is the current thread in binding mode? |
#_building | Execute a block in building mode. |
#_building? | Is the current thread in building mode? |
#_creating? | Is the current thread in creating mode? |
#_loading | Execute a block in loading mode. |
#_loading? | Is the current thread in loading mode? |
Instance Method Summary
-
#bind_one(doc)
Binds a single document with the inverse association.
-
#unbind_one(doc)
Unbind a single document.
::Mongoid::Association::Bindable
- Included
#binding | Execute the provided block inside a binding. |
#initialize | Create the new binding. |
#bind_foreign_key |
|
#bind_from_relational_parent | Bind the provided document with the base from the parent association. |
#bind_inverse | Bind the inverse document to the child document so that the in memory instances are the same. |
#bind_polymorphic_inverse_type |
|
#bind_polymorphic_type |
|
#check_inverse! | Check if the inverse is properly defined. |
#record_id, | |
#remove_associated | Remove the associated document from the inverse’s association. |
#remove_associated_in_to | Remove the associated document from the inverse’s association. |
#remove_associated_many | Remove the associated document from the inverse’s association. |
#set_base_association | Ensure that the association on the base is correct, for the cases where we have multiple belongs to definitions and were are setting different parents in memory in order. |
#try_method | Convenience method to perform |
#unbind_from_relational_parent | Bind the provided document with the base from the parent association. |
Instance Method Details
#bind_one(doc)
Binds a single document with the inverse association. Used specifically when appending to the proxy.
# File 'lib/mongoid/association/referenced/has_many/binding.rb', line 18
def bind_one(doc) binding do bind_from_relational_parent(doc) end end
#unbind_one(doc)
Unbind a single document.
# File 'lib/mongoid/association/referenced/has_many/binding.rb', line 28
def unbind_one(doc) binding do unbind_from_relational_parent(doc) end end