fields-serializer 0.2.2 → 0.2.3
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 -2
- 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: ce61523be03a0cc30c6780f9a5c4c8da5d2a95ff
|
4
|
+
data.tar.gz: 709237b398c85eaf48d2257613fd70ec1e21e858
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2e4d0992900760c71eade0df25099e2489a8ac6d9b383e1976ffc24b0ab426824f81d0abe37dc3ac44bd2b80386a540b7ef77b7df415b2388d14a6add3811ab
|
7
|
+
data.tar.gz: fa80b323bf92924c588ce9f0a6b8e68e6248a183ed50f4035124b9fa65c3620725b625cd3d50fcc984bf9411af913bdb302f47a703a31de22aa64478b46b959c
|
@@ -19,10 +19,10 @@ module Fields
|
|
19
19
|
nested_fields.inject([{}]) do |result, attribute_structure|
|
20
20
|
if attribute_structure.is_a?(Hash)
|
21
21
|
result.first.deep_merge!(attribute_structure) { |_, u, v| u == v ? u : [u, v] }
|
22
|
-
result
|
23
22
|
else
|
24
|
-
result << attribute_structure
|
23
|
+
result << attribute_structure unless result.first.dig(attribute_structure) || result.include?(attribute_structure)
|
25
24
|
end
|
25
|
+
result
|
26
26
|
end.map(&:presence).compact
|
27
27
|
end
|
28
28
|
|