Skip to content

Commit a5e5cd6

Browse files
Docs: Use Mongoid::Association::Relatable instead of Mongoid::Association (#5547)
1 parent 1398384 commit a5e5cd6

File tree

33 files changed

+61
-59
lines changed

33 files changed

+61
-59
lines changed

lib/mongoid/association/accessors.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Accessors
1717
#
1818
# @param [ String | Symbol ] name The name of the association.
1919
# @param [ Hash | BSON::ObjectId ] object The id or attributes to use.
20-
# @param [ Association ] association The association metadata.
20+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
2121
# @param [ Hash ] selected_fields Fields which were retrieved via #only.
2222
# If selected_fields is specified, fields not listed in it will not be
2323
# accessible in the built document.
@@ -34,7 +34,7 @@ def __build__(name, object, association, selected_fields = nil)
3434
# person.create_relation(document, association)
3535
#
3636
# @param [ Document | Array<Document> ] object The association target.
37-
# @param [ Association ] association The association metadata.
37+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
3838
# @param [ Hash ] selected_fields Fields which were retrieved via #only.
3939
# If selected_fields is specified, fields not listed in it will not be
4040
# accessible in the created association document.
@@ -99,7 +99,7 @@ def set_relation(name, relation)
9999
# document.get_relation(:name, association)
100100
#
101101
# @param [ Symbol ] name The name of the association.
102-
# @param [ Association ] association The association metadata.
102+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
103103
# @param [ Object ] object The object used to build the association.
104104
# @param [ true | false ] reload If the association is to be reloaded.
105105
#
@@ -268,7 +268,7 @@ def parse_args(*args)
268268
# person.has_game?
269269
# person.game?
270270
#
271-
# @param [ Association ] association The association.
271+
# @param [ Mongoid::Association::Relatable ] association The association.
272272
#
273273
# @return [ Class ] The model being set up.
274274
def self.define_existence_check!(association)
@@ -290,7 +290,7 @@ def #{name}?
290290
# @example Set up the getter for the association.
291291
# Person.define_getter!(association)
292292
#
293-
# @param [ Association ] association The association metadata for the association.
293+
# @param [ Mongoid::Association::Relatable ] association The association metadata for the association.
294294
#
295295
# @return [ Class ] The class being set up.
296296
def self.define_getter!(association)
@@ -312,7 +312,7 @@ def self.define_getter!(association)
312312
# @example Set up the ids getter for the association.
313313
# Person.define_ids_getter!(association)
314314
#
315-
# @param [ Association ] association The association metadata for the association.
315+
# @param [ Mongoid::Association::Relatable ] association The association metadata for the association.
316316
#
317317
# @return [ Class ] The class being set up.
318318
def self.define_ids_getter!(association)
@@ -332,7 +332,7 @@ def self.define_ids_getter!(association)
332332
# @example Set up the setter for the association.
333333
# Person.define_setter!(association)
334334
#
335-
# @param [ Association ] association The association metadata for the association.
335+
# @param [ Mongoid::Association::Relatable ] association The association metadata for the association.
336336
#
337337
# @return [ Class ] The class being set up.
338338
def self.define_setter!(association)
@@ -363,7 +363,7 @@ def self.define_setter!(association)
363363
# @example Set up the id_setter for the association.
364364
# Person.define_ids_setter!(association)
365365
#
366-
# @param [ Association ] association The association for the association.
366+
# @param [ Mongoid::Association::Relatable ] association The association for the association.
367367
#
368368
# @return [ Class ] The class being set up.
369369
def self.define_ids_setter!(association)
@@ -382,7 +382,7 @@ def self.define_ids_setter!(association)
382382
# @example
383383
# Person.define_builder!(association)
384384
#
385-
# @param [ Association ] association The association for the association.
385+
# @param [ Mongoid::Association::Relatable ] association The association for the association.
386386
#
387387
# @return [ Class ] The class being set up.
388388
def self.define_builder!(association)
@@ -407,7 +407,7 @@ def self.define_builder!(association)
407407
# @example
408408
# Person.define_creator!(association)
409409
#
410-
# @param [ Association ] association The association for the association.
410+
# @param [ Mongoid::Association::Relatable ] association The association for the association.
411411
#
412412
# @return [ Class ] The class being set up.
413413
def self.define_creator!(association)

lib/mongoid/association/bindable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Bindable
1616
#
1717
# @param [ Document ] base The base of the binding.
1818
# @param [ Document | Array<Document> ] target The target of the binding.
19-
# @param [ Association ] association The association metadata.
19+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
2020
def initialize(base, target, association)
2121
@_base, @_target, @_association = base, target, association
2222
end

lib/mongoid/association/builders.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def parse_args(*args)
3939
# @example
4040
# Person.define_builder!(association)
4141
#
42-
# @param [ Association ] association The association metadata for the association.
42+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
4343
#
4444
# @return [ Class ] The class being set up.
4545
def self.define_builder!(association)
@@ -63,7 +63,7 @@ def self.define_builder!(association)
6363
# @example
6464
# Person.define_creator!(association)
6565
#
66-
# @param [ Association ] association The association metadata for the association.
66+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
6767
#
6868
# @return [ Class ] The class being set up.
6969
def self.define_creator!(association)

lib/mongoid/association/depending.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _all_dependents
4444
# @example Set up cascading information
4545
# Mongoid::Association::Depending.define_dependency!(association)
4646
#
47-
# @param [ Association ] association The association metadata.
47+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
4848
#
4949
# @return [ Class ] The class of the document.
5050
def self.define_dependency!(association)

lib/mongoid/association/eager_loadable.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ def eager_load(docs)
2424
# recursively to load the associations of the given documents'
2525
# subdocuments.
2626
#
27-
# @param [ Array<Association> ] associations The associations to load.
27+
# @param [ Array<Mongoid::Association::Relatable> ] associations
28+
# The associations to load.
2829
# @param [ Array<Document> ] document The documents.
2930
def preload(associations, docs)
3031
assoc_map = associations.group_by(&:inverse_class_name)

lib/mongoid/association/embedded/embedded_in/proxy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Proxy < Association::One
1414
#
1515
# @param [ Document ] base The document the association hangs off of.
1616
# @param [ Document ] target The target (parent) of the association.
17-
# @param [ Association ] association The association metadata.
17+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
1818
#
1919
# @return [ In ] The proxy.
2020
def initialize(base, target, association)

lib/mongoid/association/embedded/embeds_many/proxy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def find(*args, &block)
251251
#
252252
# @param [ Document ] base The document this association hangs off of.
253253
# @param [ Array<Document> ] target The child documents of the association.
254-
# @param [ Association ] association The association metadata
254+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
255255
#
256256
# @return [ Many ] The proxy.
257257
def initialize(base, target, association)

lib/mongoid/association/embedded/embeds_one/proxy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Proxy < Association::One
2525
#
2626
# @param [ Document ] base The document this association hangs off of.
2727
# @param [ Document ] target The child document in the association.
28-
# @param [ Association ] association The association metadata.
28+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
2929
def initialize(base, target, association)
3030
init(base, target, association) do
3131
characterize_one(_target)

lib/mongoid/association/nested/many.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def build(parent, options = {})
4040
# @example Initialize the builder.
4141
# Many.new(association, attributes, options)
4242
#
43-
# @param [ Association ] association The association metadata.
43+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
4444
# @param [ Hash ] attributes The attributes hash to attempt to set.
4545
# @param [ Hash ] options The options defined.
4646
def initialize(association, attributes, options = {})

lib/mongoid/association/nested/one.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def build(parent)
4343
# @example Instantiate the builder.
4444
# One.new(association, attributes)
4545
#
46-
# @param [ Association ] association The association metadata.
46+
# @param [ Mongoid::Association::Relatable ] association The association metadata.
4747
# @param [ Hash ] attributes The attributes hash to attempt to set.
4848
# @param [ Hash ] options The options defined.
4949
def initialize(association, attributes, options)

0 commit comments

Comments
 (0)