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