denormalize_mm 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/mongo_mapper/denormalization.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzkyNjZiMWNmNzg2NDk0NGZiZmJiMWQ2MWUzNzJhM2MzZTA5OWY3Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDY4MzA2MTU1YjNiNjM2MmFkYzY4MWNkODk3NWY1OTk4NTczNTM3ZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTNjOGQ5MjkwMjBmNWMxZDY5NjQ2YmJiZWFkODFlYjQxZmRmYzNjNWQwZmFi
|
10
|
+
YTk4OGFjMDdhNDk5M2JmZTZiZWM2MjE1MWM1YjlkOWQyZTM3YjA4Zjc4ZWM2
|
11
|
+
NDg0OWFjYWU2MzI2YjI0NjgzOThjZTMzZmQyZmM2M2NlZmUzNzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjM0MTAzNWRhMGMwOGI0MzRkM2VlZGI5NjA4NjBjNWNiNDk0MzM1Y2U1OGNj
|
14
|
+
NzA2YTg2ZjVkMjkzM2U5ODdjODdkNTZhMzQxMjFiYTQ0MWI2NWIzMmQwNGY4
|
15
|
+
YWY3NmYzNTY1MmE3OTg1OGMzZWE3YzhkNTUzMDNmYWE1OTQ4ZmU=
|
@@ -72,12 +72,15 @@ module MongoMapper::Denormalization
|
|
72
72
|
if self.#{field}_changed?
|
73
73
|
db = MongoMapper.database
|
74
74
|
|
75
|
+
new_value = self.#{field}
|
76
|
+
new_value = new_value.utc if new_value.is_a?(Time) && new_value.respond_to?(:utc)
|
77
|
+
|
75
78
|
find_query = {
|
76
79
|
:#{association}_id => self.id
|
77
80
|
}
|
78
81
|
update_query = {
|
79
82
|
'$set' => {
|
80
|
-
:#{target_field_code} =>
|
83
|
+
:#{target_field_code} => new_value
|
81
84
|
}
|
82
85
|
}
|
83
86
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: denormalize_mm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Taylor
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Helpers to denormalize fields easily on mongo mapper models
|
15
15
|
email: scott@railsnewbie.com
|