mongoid-denormalize 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -1
- data/README.md +1 -1
- data/lib/mongoid-denormalize.rb +2 -2
- data/lib/mongoid-denormalize/version.rb +1 -1
- data/mongoid-denormalize.gemspec +1 -0
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bee7a1cf0a5f4615181f6bb6018f61ca6cc8ee1376860ae2643a6172d286bab0
|
4
|
+
data.tar.gz: e3b842b6209f14f87ac48cdcc94a23af4308ebe8de7887979c6c06ce6f321fe3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df7533f837a55e9a3177eb13d11a5bf1fec91f1c9cd34509a646dbed69fe0ca695841e927b5523a4f9ce0b1592265e18a29213d701e30e28aedddb9f983ccc51
|
7
|
+
data.tar.gz: 7d70ca109458515122ed18507256440f723e1b49d55dcff0a2422991d9ad08ac9693e257b54c8c666527c7725f7f64ba35e570f54bd80dac2d3c654f2677228a
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Mongoid::Denormalize
|
2
|
-
![Build Status](https://travis-ci.org/
|
2
|
+
![Build Status](https://travis-ci.org/nosolosoftware/mongoid-denormalize.svg?branch=master)
|
3
3
|
|
4
4
|
Helper module for denormalizing association attributes in Mongoid models
|
5
5
|
|
data/lib/mongoid-denormalize.rb
CHANGED
@@ -55,9 +55,9 @@ module Mongoid
|
|
55
55
|
from = options[:from].to_s
|
56
56
|
|
57
57
|
child_class.send(options[:child_callback] || 'before_save') do
|
58
|
-
if send(
|
58
|
+
if send("#{from}_id_changed?")
|
59
59
|
fields.each do |field|
|
60
|
-
send("#{field[:as]}=", send(from)
|
60
|
+
send("#{field[:as]}=", send(from)&.send(field[:name]))
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
data/mongoid-denormalize.gemspec
CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
25
|
spec.add_development_dependency 'bundler', '~> 1.15'
|
26
|
+
spec.add_development_dependency 'mongoid-compatibility', '~> 0.5.1'
|
26
27
|
spec.add_development_dependency 'rake', '~> 10.0'
|
27
28
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
29
|
spec.add_dependency 'mongoid', ['>= 3.0', '< 7.0']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-denormalize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rjurado01
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.15'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mongoid-compatibility
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.5.1
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.5.1
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,8 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
126
|
- !ruby/object:Gem::Version
|
113
127
|
version: '0'
|
114
128
|
requirements: []
|
115
|
-
|
116
|
-
rubygems_version: 2.7.6
|
129
|
+
rubygems_version: 3.0.1
|
117
130
|
signing_key:
|
118
131
|
specification_version: 4
|
119
132
|
summary: Denormalize fields from relations
|