decanter 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/decanter/core.rb +9 -2
- data/lib/decanter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42bc613e6f1049e3332f4ed3bad67d6031be513c
|
4
|
+
data.tar.gz: bc2fbd47a658c6dc924ea3de2667ab73c6c3b723
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43919de7aab2fce821689d08b631ff3e18226cd6e54823d979521073df659fe14bdd2178bac3713f3dc6c0399c58867ed0eb2cbda4b94c14ab035e2489fa57ef
|
7
|
+
data.tar.gz: ae021eb752244c37311232ec2b1213755c2f20efaa7b16bca9a3d7200ce8db052e8a9c74bc6fcb9e21775a487f04127216c9dc62dfa1e312c1fbe52365ff23d3
|
data/lib/decanter/core.rb
CHANGED
@@ -60,7 +60,6 @@ module Decanter
|
|
60
60
|
# protected
|
61
61
|
|
62
62
|
def unhandled_keys(args)
|
63
|
-
|
64
63
|
unhandled_keys = args.keys.map(&:to_sym) - handlers.keys.flatten.uniq
|
65
64
|
|
66
65
|
if unhandled_keys.any?
|
@@ -95,10 +94,18 @@ module Decanter
|
|
95
94
|
end
|
96
95
|
|
97
96
|
def handle_has_many(handler, values)
|
98
|
-
|
97
|
+
decanter = decanter_for_handler(handler)
|
98
|
+
if values.is_a?(Hash)
|
99
|
+
parsed_values = values.map do |index, input_values|
|
100
|
+
next if input_values.nil?
|
101
|
+
decanter.decant(input_values)
|
102
|
+
end
|
103
|
+
return { handler[:key] => parsed_values }
|
104
|
+
else
|
99
105
|
{
|
100
106
|
handler[:key] => values.compact.map { |value| decanter.decant(value) }
|
101
107
|
}
|
108
|
+
end
|
102
109
|
end
|
103
110
|
|
104
111
|
def handle_has_one(handler, values)
|
data/lib/decanter/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decanter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Francis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-02-
|
12
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|