mongoid 3.0.20 → 3.0.21

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,13 @@
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.21
7
+
8
+ ### Resolved Issues
9
+
10
+ * \#2781 / * \#2777 - Fixed issue with serialization of `DateTime` that was
11
+ only present in Rails environments.
12
+
6
13
  ## 3.0.20
7
14
 
8
15
  ### Resolved Issues
@@ -65,9 +65,11 @@ module Mongoid
65
65
  return nil if object.blank?
66
66
  begin
67
67
  time = object.__mongoize_time__
68
- return time.utc if time.is_a?(::Time)
69
- usec = time.sec_fraction * 10**6
70
- ::Time.at(time.to_i, usec).utc
68
+ if time.respond_to?(:sec_fraction)
69
+ ::Time.at(time.to_i, time.sec_fraction * 10**6).utc
70
+ else
71
+ ::Time.at(time.to_i, time.usec).utc
72
+ end
71
73
  rescue ArgumentError
72
74
  raise Errors::InvalidTime.new(object)
73
75
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Mongoid
3
- VERSION = "3.0.20"
3
+ VERSION = "3.0.21"
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.20
4
+ version: 3.0.21
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-03 00:00:00.000000000 Z
12
+ date: 2013-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel