mongoid 3.0.22 → 3.0.23

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.
@@ -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.5.2 (branch: 2.5.0-stable)
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
 
@@ -270,7 +270,7 @@ module Mongoid
270
270
  #
271
271
  # @since 1.0.0
272
272
  def typed_value_for(key, value)
273
- fields.has_key?(key) ? fields[key].mongoize(value) : value
273
+ fields.has_key?(key) ? fields[key].mongoize(value) : value.mongoize
274
274
  end
275
275
 
276
276
  module ClassMethods
@@ -81,7 +81,7 @@ module Mongoid
81
81
  #
82
82
  # @since 3.0.0
83
83
  def numeric?
84
- true if Float(self) rescue false
84
+ true if Float(self) rescue (self == "NaN")
85
85
  end
86
86
 
87
87
  # Get the string as a getter string.
@@ -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? && !_assigning?
56
+ if !docs.empty?
57
57
  collection.find(selector).update("$pullAll" => { path => removals })
58
58
  post_process_batch_remove(docs, method)
59
59
  end
@@ -25,6 +25,7 @@ module Mongoid
25
25
  # @since 3.0.15
26
26
  def marshal_load(data)
27
27
  @base, @target, @metadata = data
28
+ extend_proxy(metadata.extension) if metadata.extension?
28
29
  end
29
30
  end
30
31
  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(consistency: :strong).exists?
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
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Mongoid
3
- VERSION = "3.0.22"
3
+ VERSION = "3.0.23"
4
4
  end
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.22
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 00:00:00.000000000 Z
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.24
367
+ rubygems_version: 1.8.25
368
368
  signing_key:
369
369
  specification_version: 3
370
370
  summary: Elegant Persistance in Ruby for MongoDB.