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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cfbfde43b5e68c8a3b8f9751b2d26900cde08db
4
- data.tar.gz: 825de6ba6491be0c3be8d0b21df8ddcdf2299599
3
+ metadata.gz: 1984a523795e002825a7fb2148a34101900da937
4
+ data.tar.gz: e217a1421129b06031a8acb0f9c00bd4c00557cc
5
5
  SHA512:
6
- metadata.gz: '0119c1d7ea09944f8e6d2483b791d3f424ffd873d88226e4b4d5d1822c35c461cc95e6513027cc5bf3013392039962c9f85f1469af7eaee3cfdfc7a87d763314'
7
- data.tar.gz: fa54f65e8a1f660b65fd773929067e7e5058c2d46a44d01bb4b2970751faa6485a785b6aaae88f9970d4ec2a466283f76a8da7463d3761b2a20cc572bbe7e104
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] } && result
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
@@ -1,5 +1,5 @@
1
1
  module Fields
2
2
  module Serializer
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
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.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Chinery