mongoid 3.0.22 → 3.0.23
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +25 -1
- data/lib/mongoid/attributes.rb +1 -1
- data/lib/mongoid/extensions/string.rb +1 -1
- data/lib/mongoid/hierarchy.rb +1 -0
- data/lib/mongoid/relations/embedded/batchable.rb +1 -1
- data/lib/mongoid/relations/marshalable.rb +1 -0
- data/lib/mongoid/validations/uniqueness.rb +18 -1
- data/lib/mongoid/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,24 @@
|
|
3
3
|
For instructions on upgrading to newer versions, visit
|
4
4
|
[mongoid.org](http://mongoid.org/en/mongoid/docs/upgrading.html).
|
5
5
|
|
6
|
+
## 3.0.23
|
7
|
+
|
8
|
+
### Resolved Issues
|
9
|
+
|
10
|
+
* \#2851 Fixed BigDecimal demongoization of NaN values. (nkem)
|
11
|
+
|
12
|
+
* \#2841 Calling `delete_all` or `destroy_all` on an embeds many when in the
|
13
|
+
middle of a parent update will now properly execute the deletion.
|
14
|
+
(Arthur Neves)
|
15
|
+
|
16
|
+
* \#2835 Fixed clearing of persistence options in uniqueness validator.
|
17
|
+
|
18
|
+
* \#2826 Dynamic fields are now properly mongoized.
|
19
|
+
|
20
|
+
* \#2822 Marshal load of relations now properly reapplies extensions.
|
21
|
+
|
22
|
+
* \#2821 Autosaved relations should be duped in inheriting classes.
|
23
|
+
|
6
24
|
## 3.0.22
|
7
25
|
|
8
26
|
### Resolved Issues
|
@@ -1427,7 +1445,13 @@ For instructions on upgrading to newer versions, visit
|
|
1427
1445
|
* \#685 Attempting to use versioning with embedded documents will now
|
1428
1446
|
raise a proper error alerting the developer this is not allowed.
|
1429
1447
|
|
1430
|
-
## 2.
|
1448
|
+
## 2.6.0
|
1449
|
+
|
1450
|
+
### New Features
|
1451
|
+
|
1452
|
+
* \#2709 Backported the `touch` functionality from Mongoid 3.
|
1453
|
+
|
1454
|
+
## 2.5.2
|
1431
1455
|
|
1432
1456
|
### Resolved Issues
|
1433
1457
|
|
data/lib/mongoid/attributes.rb
CHANGED
data/lib/mongoid/hierarchy.rb
CHANGED
@@ -161,6 +161,7 @@ module Mongoid
|
|
161
161
|
subclass.pre_processed_defaults = pre_processed_defaults.dup
|
162
162
|
subclass.post_processed_defaults = post_processed_defaults.dup
|
163
163
|
subclass.scopes = scopes.dup
|
164
|
+
subclass.autosaved_relations = autosaved_relations.dup
|
164
165
|
end
|
165
166
|
end
|
166
167
|
end
|
@@ -53,7 +53,7 @@ module Mongoid
|
|
53
53
|
# @since 3.0.0
|
54
54
|
def batch_remove(docs, method = :delete)
|
55
55
|
removals = pre_process_batch_remove(docs, method)
|
56
|
-
if !docs.empty?
|
56
|
+
if !docs.empty?
|
57
57
|
collection.find(selector).update("$pullAll" => { path => removals })
|
58
58
|
post_process_batch_remove(docs, method)
|
59
59
|
end
|
@@ -267,7 +267,7 @@ module Mongoid
|
|
267
267
|
# @since 2.4.10
|
268
268
|
def validate_root(document, attribute, value)
|
269
269
|
criteria = create_criteria(klass, document, attribute, value)
|
270
|
-
if criteria.with(
|
270
|
+
if criteria.with(persistence_options(criteria)).exists?
|
271
271
|
add_error(document, attribute, value)
|
272
272
|
end
|
273
273
|
end
|
@@ -288,6 +288,23 @@ module Mongoid
|
|
288
288
|
document.send("attribute_changed?", attribute.to_s) ||
|
289
289
|
scope_value_changed?(document)
|
290
290
|
end
|
291
|
+
|
292
|
+
# Get the persistence options to perform to check, merging with any
|
293
|
+
# existing.
|
294
|
+
#
|
295
|
+
# @api private
|
296
|
+
#
|
297
|
+
# @example Get the persistence options.
|
298
|
+
# validator.persistence_options(criteria)
|
299
|
+
#
|
300
|
+
# @param [ Criteria ] criteria The criteria.
|
301
|
+
#
|
302
|
+
# @return [ Hash ] The persistence options.
|
303
|
+
#
|
304
|
+
# @since 3.0.23
|
305
|
+
def persistence_options(criteria)
|
306
|
+
(criteria.klass.persistence_options || {}).merge!(consistency: :strong)
|
307
|
+
end
|
291
308
|
end
|
292
309
|
end
|
293
310
|
end
|
data/lib/mongoid/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.23
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -364,7 +364,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
364
364
|
version: 1.3.6
|
365
365
|
requirements: []
|
366
366
|
rubyforge_project: mongoid
|
367
|
-
rubygems_version: 1.8.
|
367
|
+
rubygems_version: 1.8.25
|
368
368
|
signing_key:
|
369
369
|
specification_version: 3
|
370
370
|
summary: Elegant Persistance in Ruby for MongoDB.
|