mongoid 5.2.1 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +1 -0
- data.tar.gz.sig +0 -0
- data/lib/mongoid/atomic.rb +1 -1
- data/lib/mongoid/atomic/modifiers.rb +12 -8
- data/lib/mongoid/attributes.rb +1 -2
- data/lib/mongoid/attributes/dynamic.rb +3 -2
- data/lib/mongoid/attributes/nested.rb +1 -1
- data/lib/mongoid/attributes/processing.rb +0 -4
- data/lib/mongoid/changeable.rb +1 -1
- data/lib/mongoid/clients/options.rb +3 -2
- data/lib/mongoid/contextual/atomic.rb +9 -6
- data/lib/mongoid/contextual/geo_near.rb +3 -2
- data/lib/mongoid/contextual/map_reduce.rb +4 -0
- data/lib/mongoid/contextual/memory.rb +1 -1
- data/lib/mongoid/contextual/mongo.rb +3 -3
- data/lib/mongoid/contextual/none.rb +2 -2
- data/lib/mongoid/copyable.rb +0 -4
- data/lib/mongoid/criteria.rb +1 -1
- data/lib/mongoid/criteria/findable.rb +3 -2
- data/lib/mongoid/criteria/includable.rb +2 -2
- data/lib/mongoid/errors/delete_restriction.rb +2 -2
- data/lib/mongoid/errors/inverse_not_found.rb +1 -1
- data/lib/mongoid/extensions/hash.rb +3 -2
- data/lib/mongoid/extensions/object.rb +2 -2
- data/lib/mongoid/extensions/time.rb +1 -1
- data/lib/mongoid/factory.rb +0 -1
- data/lib/mongoid/fields/foreign_key.rb +2 -2
- data/lib/mongoid/findable.rb +1 -1
- data/lib/mongoid/indexable.rb +3 -2
- data/lib/mongoid/indexable/specification.rb +1 -1
- data/lib/mongoid/interceptable.rb +2 -2
- data/lib/mongoid/loggable.rb +1 -1
- data/lib/mongoid/matchable.rb +2 -2
- data/lib/mongoid/persistable.rb +0 -3
- data/lib/mongoid/persistable/creatable.rb +0 -2
- data/lib/mongoid/query_cache.rb +5 -1
- data/lib/mongoid/relations/accessors.rb +1 -2
- data/lib/mongoid/relations/bindings/embedded/in.rb +0 -4
- data/lib/mongoid/relations/bindings/embedded/many.rb +1 -8
- data/lib/mongoid/relations/bindings/embedded/one.rb +0 -10
- data/lib/mongoid/relations/bindings/referenced/many.rb +0 -4
- data/lib/mongoid/relations/builders/embedded/one.rb +1 -1
- data/lib/mongoid/relations/builders/nested_attributes/many.rb +1 -1
- data/lib/mongoid/relations/conversions.rb +1 -1
- data/lib/mongoid/relations/counter_cache.rb +10 -10
- data/lib/mongoid/relations/eager/base.rb +4 -4
- data/lib/mongoid/relations/embedded/batchable.rb +33 -9
- data/lib/mongoid/relations/embedded/in.rb +1 -3
- data/lib/mongoid/relations/embedded/many.rb +4 -5
- data/lib/mongoid/relations/embedded/one.rb +1 -3
- data/lib/mongoid/relations/macros.rb +2 -1
- data/lib/mongoid/relations/metadata.rb +3 -3
- data/lib/mongoid/relations/nested_builder.rb +1 -1
- data/lib/mongoid/relations/proxy.rb +3 -2
- data/lib/mongoid/relations/referenced/in.rb +1 -4
- data/lib/mongoid/relations/referenced/many.rb +3 -5
- data/lib/mongoid/relations/referenced/many_to_many.rb +1 -1
- data/lib/mongoid/relations/referenced/one.rb +0 -2
- data/lib/mongoid/relations/reflections.rb +2 -2
- data/lib/mongoid/scopable.rb +2 -2
- data/lib/mongoid/serializable.rb +3 -2
- data/lib/mongoid/tasks/database.rb +2 -1
- data/lib/mongoid/threaded.rb +4 -4
- data/lib/mongoid/validatable.rb +1 -1
- data/lib/mongoid/validatable/macros.rb +4 -2
- data/lib/mongoid/version.rb +1 -1
- data/spec/mongoid/atomic/modifiers_spec.rb +17 -17
- data/spec/mongoid/atomic_spec.rb +17 -17
- data/spec/mongoid/clients/options_spec.rb +9 -0
- data/spec/mongoid/contextual/atomic_spec.rb +3 -3
- data/spec/mongoid/persistable/savable_spec.rb +2 -2
- data/spec/mongoid/persistable/updatable_spec.rb +2 -2
- data/spec/mongoid/positional_spec.rb +10 -10
- data/spec/spec_helper.rb +1 -1
- metadata +440 -418
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '08c29d43d146e27e4060d618a847e86dce00eb9ed09ccc040176bb36607c85d8'
|
4
|
+
data.tar.gz: 36e253fc8ba8ee3b873d3b86b644134a71927761ae6b3d3ee87681815552a22d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 628fe19e7e6e0472e18d640d807c4aa611da9da1944992ee828717acf82d0d84f35891fcd149bf48d3fe12617e44c1d840323b6d014705d5f6691ff3e54ddbcb
|
7
|
+
data.tar.gz: 5ca94d2eff2fc0249af67f84ed337fcee8a6c433e5b2c16b51a25304226960e33ef3b3f634ba96b382f6277d39b4797298af969e1560b4ead3ed308c2272c222
|
checksums.yaml.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
�l�jY~�8�Kb�����6&l'Q�;Q�,�K��7��q���#�����И����Y�������!����|>�z��f0����l�f3���]fxi�Q�I�^~�%�?��W��r�O&laו��m}�`����ܺfy���+ȶ�RyXƅ^f<��r�3�\܁x3�gSղ#� ��j�ჟ�t$�vc�T�t�Zc��5��nG��8��S�[)��j0�"�k�+D�I���6���rZ�d
|
data.tar.gz.sig
ADDED
Binary file
|
data/lib/mongoid/atomic.rb
CHANGED
@@ -31,7 +31,7 @@ module Mongoid
|
|
31
31
|
# @example Add the atomic pull.
|
32
32
|
# person.add_atomic_pull(address)
|
33
33
|
#
|
34
|
-
# @param [ Document ] The embedded document to pull.
|
34
|
+
# @param [ Document ] document The embedded document to pull.
|
35
35
|
#
|
36
36
|
# @since 2.2.0
|
37
37
|
def add_atomic_pull(document)
|
@@ -68,7 +68,7 @@ module Mongoid
|
|
68
68
|
modifications.each_pair do |field, value|
|
69
69
|
push_fields[field] = field
|
70
70
|
mods = push_conflict?(field) ? conflicting_pushes : pushes
|
71
|
-
add_operation(mods, field, Array.wrap(value))
|
71
|
+
add_operation(mods, field, {'$each' => Array.wrap(value)})
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
@@ -118,8 +118,12 @@ module Mongoid
|
|
118
118
|
# @since 2.2.0
|
119
119
|
def add_operation(mods, field, value)
|
120
120
|
if mods.has_key?(field)
|
121
|
-
|
122
|
-
|
121
|
+
if mods[field].is_a?(Array)
|
122
|
+
value.each do |val|
|
123
|
+
mods[field].push(val)
|
124
|
+
end
|
125
|
+
elsif mods[field]['$each']
|
126
|
+
mods[field]['$each'].concat(value['$each'])
|
123
127
|
end
|
124
128
|
else
|
125
129
|
mods[field] = value
|
@@ -190,7 +194,7 @@ module Mongoid
|
|
190
194
|
#
|
191
195
|
# @since 2.2.0
|
192
196
|
def conflicting_pushes
|
193
|
-
conflicts["$
|
197
|
+
conflicts["$push"] ||= {}
|
194
198
|
end
|
195
199
|
|
196
200
|
# Get the conflicting set modifications.
|
@@ -277,16 +281,16 @@ module Mongoid
|
|
277
281
|
self["$pull"] ||= {}
|
278
282
|
end
|
279
283
|
|
280
|
-
# Get the $
|
284
|
+
# Get the $push/$each operations or initialize a new one.
|
281
285
|
#
|
282
|
-
# @example Get the $
|
286
|
+
# @example Get the $push/$each operations.
|
283
287
|
# modifiers.pushes
|
284
288
|
#
|
285
|
-
# @return [ Hash ] The $
|
289
|
+
# @return [ Hash ] The $push/$each operations.
|
286
290
|
#
|
287
291
|
# @since 2.1.0
|
288
292
|
def pushes
|
289
|
-
self["$
|
293
|
+
self["$push"] ||= {}
|
290
294
|
end
|
291
295
|
|
292
296
|
# Get the $set operations or intialize a new one.
|
data/lib/mongoid/attributes.rb
CHANGED
@@ -218,7 +218,6 @@ module Mongoid
|
|
218
218
|
# person.attributes = { :title => "Mr." }
|
219
219
|
#
|
220
220
|
# @param [ Hash ] attrs The new attributes to set.
|
221
|
-
# @param [ Boolean ] guard_protected_attributes False to skip mass assignment protection.
|
222
221
|
#
|
223
222
|
# @since 1.0.0
|
224
223
|
def write_attributes(attrs = nil)
|
@@ -332,7 +331,7 @@ module Mongoid
|
|
332
331
|
# the value is valid for given a field.
|
333
332
|
# For now, only Hash and Array fields are validated.
|
334
333
|
#
|
335
|
-
# @param [ String, Symbol ]
|
334
|
+
# @param [ String, Symbol ] access The name of the attribute to validate.
|
336
335
|
# @param [ Object ] value The to be validated.
|
337
336
|
#
|
338
337
|
# @since 3.0.10
|
@@ -13,7 +13,8 @@ module Mongoid
|
|
13
13
|
# @example Does this object respond to the method?
|
14
14
|
# person.respond_to?(:title)
|
15
15
|
#
|
16
|
-
# @param [ Array ]
|
16
|
+
# @param [ Array ] name The name of the method.
|
17
|
+
# @param [ true, false ] include_private
|
17
18
|
#
|
18
19
|
# @return [ true, false ] True if it does, false if not.
|
19
20
|
#
|
@@ -126,7 +127,7 @@ module Mongoid
|
|
126
127
|
# document.method_missing(:test)
|
127
128
|
#
|
128
129
|
# @param [ String, Symbol ] name The name of the method.
|
129
|
-
# @param [ Array ]
|
130
|
+
# @param [ Array ] args The arguments to the method.
|
130
131
|
#
|
131
132
|
# @return [ Object ] The result of the method call.
|
132
133
|
#
|
@@ -34,7 +34,7 @@ module Mongoid
|
|
34
34
|
# accepts_nested_attributes_for :addresses, :game, :posts
|
35
35
|
# end
|
36
36
|
#
|
37
|
-
# @param [ Array<Symbol>, Hash ]
|
37
|
+
# @param [ Array<Symbol>, Hash ] args A list of relation names, followed
|
38
38
|
# by a hash of options.
|
39
39
|
#
|
40
40
|
# @option *args [ true, false ] :allow_destroy Can deletion occur?
|
@@ -118,8 +118,6 @@ module Mongoid
|
|
118
118
|
# @example Process the pending items.
|
119
119
|
# document.process_pending
|
120
120
|
#
|
121
|
-
# @param [ Hash ] options The mass assignment options.
|
122
|
-
#
|
123
121
|
# @since 2.0.0.rc.7
|
124
122
|
def process_pending
|
125
123
|
process_nested and process_relations
|
@@ -132,8 +130,6 @@ module Mongoid
|
|
132
130
|
# @example Process the relations.
|
133
131
|
# document.process_relations
|
134
132
|
#
|
135
|
-
# @param [ Hash ] options The mass assignment options.
|
136
|
-
#
|
137
133
|
# @since 2.0.0.rc.7
|
138
134
|
def process_relations
|
139
135
|
pending_relations.each_pair do |name, value|
|
data/lib/mongoid/changeable.rb
CHANGED
@@ -265,7 +265,7 @@ module Mongoid
|
|
265
265
|
# Model.create_dirty_methods("name", "name")
|
266
266
|
#
|
267
267
|
# @param [ String ] name The name of the field.
|
268
|
-
# @param [ String ]
|
268
|
+
# @param [ String ] meth The name of the accessor.
|
269
269
|
#
|
270
270
|
# @return [ Module ] The fields module.
|
271
271
|
#
|
@@ -135,7 +135,7 @@ module Mongoid
|
|
135
135
|
# Threaded.set_options(Band, { write: { w: 3 }})
|
136
136
|
#
|
137
137
|
# @param [ Class ] klass The model class.
|
138
|
-
# @param [ Mongo::Client ]
|
138
|
+
# @param [ Mongo::Client ] options The options.
|
139
139
|
#
|
140
140
|
# @return [ Mongo::Client, nil ] The client or nil if the cluster does not change.
|
141
141
|
#
|
@@ -252,8 +252,9 @@ module Mongoid
|
|
252
252
|
def with(options)
|
253
253
|
if block_given?
|
254
254
|
set_options(self, options)
|
255
|
-
yield self
|
255
|
+
result = yield self
|
256
256
|
unset_options(self)
|
257
|
+
result
|
257
258
|
else
|
258
259
|
Proxy.new(self, (persistence_options || {}).merge(options))
|
259
260
|
end
|
@@ -106,18 +106,21 @@ module Mongoid
|
|
106
106
|
view.update_many("$push" => collect_operations(pushes))
|
107
107
|
end
|
108
108
|
|
109
|
-
# Perform an atomic $
|
109
|
+
# Perform an atomic $push/$each operation on the matching documents.
|
110
110
|
#
|
111
111
|
# @example Push the values to the matching docs.
|
112
|
-
# context.
|
112
|
+
# context.push_each(members: [ "Alan", "Fletch" ])
|
113
113
|
#
|
114
114
|
# @param [ Hash ] pushes The operations.
|
115
115
|
#
|
116
116
|
# @return [ nil ] Nil.
|
117
117
|
#
|
118
|
-
# @since
|
119
|
-
def
|
120
|
-
|
118
|
+
# @since 5.4.0
|
119
|
+
def push_each(pushes)
|
120
|
+
push_each_updates = collect_operations(pushes).each.inject({}) do |ops, (field, elements)|
|
121
|
+
ops.merge!(field => { '$each' => elements })
|
122
|
+
end
|
123
|
+
view.update_many("$push" => push_each_updates)
|
121
124
|
end
|
122
125
|
|
123
126
|
# Perform an atomic $rename of fields on the matching documents.
|
@@ -157,7 +160,7 @@ module Mongoid
|
|
157
160
|
# @example Unset the field on the matches.
|
158
161
|
# context.unset(:name)
|
159
162
|
#
|
160
|
-
# @param [ String, Symbol, Array ]
|
163
|
+
# @param [ String, Symbol, Array ] args The name of the fields.
|
161
164
|
#
|
162
165
|
# @return [ nil ] Nil.
|
163
166
|
#
|
@@ -63,9 +63,10 @@ module Mongoid
|
|
63
63
|
# @example Initialize the new map/reduce.
|
64
64
|
# MapReduce.new(criteria, map, reduce)
|
65
65
|
#
|
66
|
+
# @param [ Mongo::Collection ] collection The collection to run the
|
67
|
+
# operation on.
|
66
68
|
# @param [ Criteria ] criteria The Mongoid criteria.
|
67
|
-
# @param [ String ]
|
68
|
-
# @param [ String ] reduce The reduce js function.
|
69
|
+
# @param [ String ] near
|
69
70
|
#
|
70
71
|
# @since 3.0.0
|
71
72
|
def initialize(collection, criteria, near)
|
@@ -111,6 +111,7 @@ module Mongoid
|
|
111
111
|
end
|
112
112
|
|
113
113
|
# Specifies where the map/reduce output is to be stored.
|
114
|
+
# Please see MongoDB documentation for supported map reduce options.
|
114
115
|
#
|
115
116
|
# @example Store output in memory.
|
116
117
|
# map_reduce.out(inline: 1)
|
@@ -124,6 +125,9 @@ module Mongoid
|
|
124
125
|
# @example Store output in a collection, reducing existing documents.
|
125
126
|
# map_reduce.out(reduce: "collection_name")
|
126
127
|
#
|
128
|
+
# @example Return results from map reduce.
|
129
|
+
# map_reduce.out(inline: 1)
|
130
|
+
#
|
127
131
|
# @param [ Hash ] location The place to store the results.
|
128
132
|
#
|
129
133
|
# @return [ MapReduce ] The map/reduce object.
|
@@ -197,7 +197,7 @@ module Mongoid
|
|
197
197
|
# @example Execute the command.
|
198
198
|
# context.find_one_and_update({ likes: 1 })
|
199
199
|
#
|
200
|
-
# @param [ Hash ]
|
200
|
+
# @param [ Hash ] replacement The replacement.
|
201
201
|
# @param [ Hash ] options The command options.
|
202
202
|
#
|
203
203
|
# @option options [ :before, :after ] :return_document Return the updated document
|
@@ -298,7 +298,7 @@ module Mongoid
|
|
298
298
|
# @example Map by some field.
|
299
299
|
# context.map(:field1)
|
300
300
|
#
|
301
|
-
# @
|
301
|
+
# @example Map with block.
|
302
302
|
# context.map(&:field1)
|
303
303
|
#
|
304
304
|
# @param [ Symbol ] field The field name.
|
@@ -407,7 +407,7 @@ module Mongoid
|
|
407
407
|
# @note This method will return the raw db values - it performs no custom
|
408
408
|
# serialization.
|
409
409
|
#
|
410
|
-
# @param [ String, Symbol, Array ]
|
410
|
+
# @param [ String, Symbol, Array ] fields Fields to pluck.
|
411
411
|
#
|
412
412
|
# @return [ Array<Object, Array> ] The plucked values.
|
413
413
|
#
|
@@ -57,7 +57,7 @@ module Mongoid
|
|
57
57
|
# @example Allow pluck for null context.
|
58
58
|
# context.pluck(:name)
|
59
59
|
#
|
60
|
-
# @param [ String, Symbol, Array ]
|
60
|
+
# @param [ String, Symbol, Array ] args Field or fields to pluck.
|
61
61
|
#
|
62
62
|
# @return [ Array ] Emtpy Array
|
63
63
|
def pluck(*args)
|
@@ -69,7 +69,7 @@ module Mongoid
|
|
69
69
|
# @example Create the new context.
|
70
70
|
# Null.new(criteria)
|
71
71
|
#
|
72
|
-
# @param [ Criteria ] The criteria.
|
72
|
+
# @param [ Criteria ] criteria The criteria.
|
73
73
|
#
|
74
74
|
# @since 4.0.0
|
75
75
|
def initialize(criteria)
|
data/lib/mongoid/copyable.rb
CHANGED
@@ -14,8 +14,6 @@ module Mongoid
|
|
14
14
|
# @example Clone the document.
|
15
15
|
# document.clone
|
16
16
|
#
|
17
|
-
# @param [ Document ] other The document getting cloned.
|
18
|
-
#
|
19
17
|
# @return [ Document ] The new document.
|
20
18
|
def clone
|
21
19
|
# @note This next line is here to address #2704, even though having an
|
@@ -40,8 +38,6 @@ module Mongoid
|
|
40
38
|
# @example clone document
|
41
39
|
# model.clone_document
|
42
40
|
#
|
43
|
-
# @param [ Hash ] dcoument The document with hash format
|
44
|
-
#
|
45
41
|
# @since 3.0.22
|
46
42
|
def clone_document
|
47
43
|
attrs = as_document.__deep_copy__
|
data/lib/mongoid/criteria.rb
CHANGED
@@ -386,7 +386,7 @@ module Mongoid
|
|
386
386
|
# @example Add a javascript selection.
|
387
387
|
# criteria.where("this.name == 'syd'")
|
388
388
|
#
|
389
|
-
# @param [ String, Hash ]
|
389
|
+
# @param [ String, Hash ] expression The javascript or standard selection.
|
390
390
|
#
|
391
391
|
# @raise [ UnsupportedJavascript ] If provided a string and the criteria
|
392
392
|
# is embedded.
|
@@ -8,7 +8,8 @@ module Mongoid
|
|
8
8
|
# @example Execute or raise
|
9
9
|
# criteria.execute_or_raise(id)
|
10
10
|
#
|
11
|
-
# @param [ Object ]
|
11
|
+
# @param [ Object ] ids The arguments passed.
|
12
|
+
# @param [ true, false ] multi Whether there arguments were a list.
|
12
13
|
#
|
13
14
|
# @raise [ Errors::DocumentNotFound ] If nothing returned.
|
14
15
|
#
|
@@ -66,7 +67,7 @@ module Mongoid
|
|
66
67
|
# @example Get the documents from the map or criteria.
|
67
68
|
# criteria.multiple_from_map_or_db(ids)
|
68
69
|
#
|
69
|
-
# @param [
|
70
|
+
# @param [ Array<Object> ] ids The searched ids.
|
70
71
|
#
|
71
72
|
# @return [ Array<Document> ] The found documents.
|
72
73
|
def multiple_from_db(ids)
|
@@ -48,7 +48,7 @@ module Mongoid
|
|
48
48
|
# @example Set the inclusions.
|
49
49
|
# criteria.inclusions = [ meta ]
|
50
50
|
#
|
51
|
-
# @param [ Array<Metadata> ] The inclusions.
|
51
|
+
# @param [ Array<Metadata> ] value The inclusions.
|
52
52
|
#
|
53
53
|
# @return [ Array<Metadata> ] The new inclusions.
|
54
54
|
#
|
@@ -65,7 +65,7 @@ module Mongoid
|
|
65
65
|
# criteria.add_inclusion(Person, :posts)
|
66
66
|
#
|
67
67
|
# @param [ Class, String, Symbol ] _klass The class or string/symbol of the class name.
|
68
|
-
# @param [ Symbol ]
|
68
|
+
# @param [ Symbol ] metadata The relation.
|
69
69
|
#
|
70
70
|
# @raise [ Errors::InvalidIncludes ] If no relation is found.
|
71
71
|
#
|
@@ -11,8 +11,8 @@ module Mongoid
|
|
11
11
|
# @example Create the new callbacks error.
|
12
12
|
# Callbacks.new(Post, :create!)
|
13
13
|
#
|
14
|
-
# @param [ Class ]
|
15
|
-
# @param [ Symbol ]
|
14
|
+
# @param [ Class ] document
|
15
|
+
# @param [ Symbol ] relation
|
16
16
|
#
|
17
17
|
# @since 3.0.0
|
18
18
|
def initialize(document, relation)
|
@@ -12,7 +12,7 @@ module Mongoid
|
|
12
12
|
#
|
13
13
|
# @param [ Class ] base The base class.
|
14
14
|
# @param [ Symbol ] name The name of the relation.
|
15
|
-
# @param [ Class ] The child class.
|
15
|
+
# @param [ Class ] klass The child class.
|
16
16
|
# @param [ Symbol ] inverse The attempted inverse key.
|
17
17
|
#
|
18
18
|
# @since 3.0.0
|
@@ -161,10 +161,11 @@ module Mongoid
|
|
161
161
|
# @api private
|
162
162
|
#
|
163
163
|
# @example Mongoize for the klass, field and value.
|
164
|
-
# {}.mongoize_for(Band, "name", "test")
|
164
|
+
# {}.mongoize_for("$push", Band, "name", "test")
|
165
165
|
#
|
166
|
+
# @param [ String ] operator The operator.
|
166
167
|
# @param [ Class ] klass The model class.
|
167
|
-
# @param [ String, Symbol ] The field key.
|
168
|
+
# @param [ String, Symbol ] key The field key.
|
168
169
|
# @param [ Object ] value The value to mongoize.
|
169
170
|
#
|
170
171
|
# @return [ Object ] The mongoized value.
|
@@ -94,7 +94,7 @@ module Mongoid
|
|
94
94
|
# object.do_or_do_not(:use, "The Force")
|
95
95
|
#
|
96
96
|
# @param [ String, Symbol ] name The method name.
|
97
|
-
# @param [ Array ]
|
97
|
+
# @param [ Array ] args The arguments.
|
98
98
|
#
|
99
99
|
# @return [ Object, nil ] The result of the method call or nil if the
|
100
100
|
# method does not exist.
|
@@ -209,7 +209,7 @@ module Mongoid
|
|
209
209
|
# object.you_must(:use, "The Force")
|
210
210
|
#
|
211
211
|
# @param [ String, Symbol ] name The method name.
|
212
|
-
# @param [ Array ]
|
212
|
+
# @param [ Array ] args The arguments.
|
213
213
|
#
|
214
214
|
# @return [ Object, nil ] The result of the method call or nil if the
|
215
215
|
# method does not exist. Nil if the object is frozen.
|
data/lib/mongoid/factory.rb
CHANGED
@@ -14,7 +14,6 @@ module Mongoid
|
|
14
14
|
#
|
15
15
|
# @param [ Class ] klass The class to instantiate from if _type is not present.
|
16
16
|
# @param [ Hash ] attributes The document attributes.
|
17
|
-
# @param [ Hash ] options The mass assignment scoping options.
|
18
17
|
#
|
19
18
|
# @return [ Document ] The instantiated document.
|
20
19
|
def build(klass, attributes = nil)
|
@@ -14,8 +14,8 @@ module Mongoid
|
|
14
14
|
# @param [ String ] name The name of the field.
|
15
15
|
# @param [ String ] key The atomic location of the field.
|
16
16
|
# @param [ Hash ] mods The current modifications.
|
17
|
-
# @param [ Array ]
|
18
|
-
# @param [ Array ]
|
17
|
+
# @param [ Array ] new_elements The new elements to add.
|
18
|
+
# @param [ Array ] old_elements The old elements getting removed.
|
19
19
|
#
|
20
20
|
# @since 2.4.0
|
21
21
|
def add_atomic_changes(document, name, key, mods, new_elements, old_elements)
|