@@ -15,8 +15,8 @@ module Bindable
15
15
# @example Initialize a binding.
16
16
# Binding.new(base, target, association)
17
17
#
18
- # @param [ Document ] base The base of the binding.
19
- # @param [ Document | Array<Document> ] target The target of the binding.
18
+ # @param [ Mongoid:: Document ] base The base of the binding.
19
+ # @param [ Mongoid:: Document | Array<Mongoid:: Document> ] target The target of the binding.
20
20
# @param [ Mongoid::Association::Relatable ] association The association metadata.
21
21
def initialize ( base , target , association )
22
22
@_base , @_target , @_association = base , target , association
@@ -47,7 +47,7 @@ def binding
47
47
# @example Check the inverse definition.
48
48
# binding.check_inverse!(doc)
49
49
#
50
- # @param [ Document ] doc The document getting bound.
50
+ # @param [ Mongoid:: Document ] doc The document getting bound.
51
51
#
52
52
# @raise [ Errors::InverseNotFound ] If no inverse found.
53
53
def check_inverse! ( doc )
@@ -63,7 +63,7 @@ def check_inverse!(doc)
63
63
64
64
# Remove the associated document from the inverse's association.
65
65
#
66
- # @param [ Document ] doc The document to remove.
66
+ # @param [ Mongoid:: Document ] doc The document to remove.
67
67
def remove_associated ( doc )
68
68
if inverse = _association . inverse ( doc )
69
69
if _association . many?
@@ -78,7 +78,7 @@ def remove_associated(doc)
78
78
#
79
79
# This method removes the associated on *_many relationships.
80
80
#
81
- # @param [ Document ] doc The document to remove.
81
+ # @param [ Mongoid:: Document ] doc The document to remove.
82
82
# @param [ Symbol ] inverse The name of the inverse.
83
83
def remove_associated_many ( doc , inverse )
84
84
# We only want to remove the inverse association when the inverse
@@ -98,7 +98,7 @@ def remove_associated_many(doc, inverse)
98
98
# This method removes associated on belongs_to and embedded_in
99
99
# associations.
100
100
#
101
- # @param [ Document ] doc The document to remove.
101
+ # @param [ Mongoid:: Document ] doc The document to remove.
102
102
# @param [ Symbol ] inverse The name of the inverse.
103
103
def remove_associated_in_to ( doc , inverse )
104
104
# We only want to remove the inverse association when the inverse
@@ -116,7 +116,7 @@ def remove_associated_in_to(doc, inverse)
116
116
# @example Bind the foreign key.
117
117
# binding.bind_foreign_key(post, person._id)
118
118
#
119
- # @param [ Document ] keyed The document that stores the foreign key.
119
+ # @param [ Mongoid:: Document ] keyed The document that stores the foreign key.
120
120
# @param [ Object ] id The id of the bound document.
121
121
def bind_foreign_key ( keyed , id )
122
122
unless keyed . frozen?
@@ -132,7 +132,7 @@ def bind_foreign_key(keyed, id)
132
132
# @example Bind the polymorphic type.
133
133
# binding.bind_polymorphic_type(post, "Person")
134
134
#
135
- # @param [ Document ] typed The document that stores the type field.
135
+ # @param [ Mongoid:: Document ] typed The document that stores the type field.
136
136
# @param [ String ] name The name of the model.
137
137
def bind_polymorphic_type ( typed , name )
138
138
if _association . type && !typed . frozen?
@@ -148,7 +148,7 @@ def bind_polymorphic_type(typed, name)
148
148
# @example Bind the polymorphic type.
149
149
# binding.bind_polymorphic_inverse_type(post, "Person")
150
150
#
151
- # @param [ Document ] typed The document that stores the type field.
151
+ # @param [ Mongoid:: Document ] typed The document that stores the type field.
152
152
# @param [ String ] name The name of the model.
153
153
def bind_polymorphic_inverse_type ( typed , name )
154
154
if _association . inverse_type && !typed . frozen?
@@ -164,8 +164,8 @@ def bind_polymorphic_inverse_type(typed, name)
164
164
# @example Bind the inverse.
165
165
# binding.bind_inverse(post, person)
166
166
#
167
- # @param [ Document ] doc The base document.
168
- # @param [ Document ] inverse The inverse document.
167
+ # @param [ Mongoid:: Document ] doc The base document.
168
+ # @param [ Mongoid:: Document ] inverse The inverse document.
169
169
def bind_inverse ( doc , inverse )
170
170
if doc . respond_to? ( _association . inverse_setter ) && !doc . frozen?
171
171
try_method ( doc , _association . inverse_setter , inverse )
@@ -179,7 +179,7 @@ def bind_inverse(doc, inverse)
179
179
# @example Bind the document with the base.
180
180
# binding.bind_from_relational_parent(doc)
181
181
#
182
- # @param [ Document ] doc The document to bind.
182
+ # @param [ Mongoid:: Document ] doc The document to bind.
183
183
def bind_from_relational_parent ( doc )
184
184
check_inverse! ( doc )
185
185
remove_associated ( doc )
@@ -216,7 +216,7 @@ def set_base_association
216
216
# @example Bind the document with the base.
217
217
# unbinding.unbind_from_relational_parent(doc)
218
218
#
219
- # @param [ Document ] doc The document to unbind.
219
+ # @param [ Mongoid:: Document ] doc The document to unbind.
220
220
def unbind_from_relational_parent ( doc )
221
221
check_inverse! ( doc )
222
222
bind_foreign_key ( doc , nil )
0 commit comments