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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1984a523795e002825a7fb2148a34101900da937
4
- data.tar.gz: e217a1421129b06031a8acb0f9c00bd4c00557cc
3
+ metadata.gz: ce61523be03a0cc30c6780f9a5c4c8da5d2a95ff
4
+ data.tar.gz: 709237b398c85eaf48d2257613fd70ec1e21e858
5
5
  SHA512:
6
- metadata.gz: b0305b459caa5ed77eb467827a98e747211465086494b05fad0e9281b019a321d455bc8aeb35edd38c9636ea57f3bb70dc3707d993b31843bafee54ad53319ab
7
- data.tar.gz: bedca0a204931128e8f82160c04d5749bb490960f46e1c7432c033433b30587d34e9f902ffeaf7a22ddaa7627f88d39effeefadcceb4dd40228a241320fb0010
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
 
@@ -1,5 +1,5 @@
1
1
  module Fields
2
2
  module Serializer
3
- VERSION = "0.2.2"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fields-serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Chinery