fields-serializer 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fields/serializer/active_record.rb +2 -1
- data/lib/fields/serializer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1984a523795e002825a7fb2148a34101900da937
|
4
|
+
data.tar.gz: e217a1421129b06031a8acb0f9c00bd4c00557cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0305b459caa5ed77eb467827a98e747211465086494b05fad0e9281b019a321d455bc8aeb35edd38c9636ea57f3bb70dc3707d993b31843bafee54ad53319ab
|
7
|
+
data.tar.gz: bedca0a204931128e8f82160c04d5749bb490960f46e1c7432c033433b30587d34e9f902ffeaf7a22ddaa7627f88d39effeefadcceb4dd40228a241320fb0010
|
@@ -18,7 +18,8 @@ module Fields
|
|
18
18
|
nested_fields = flatten_fields.map { |field| nested_field(field.split(".")) }.compact
|
19
19
|
nested_fields.inject([{}]) do |result, attribute_structure|
|
20
20
|
if attribute_structure.is_a?(Hash)
|
21
|
-
result.first.deep_merge!(attribute_structure) { |_, u, v| [u, v] }
|
21
|
+
result.first.deep_merge!(attribute_structure) { |_, u, v| u == v ? u : [u, v] }
|
22
|
+
result
|
22
23
|
else
|
23
24
|
result << attribute_structure
|
24
25
|
end
|