fields-serializer 0.8.3 → 0.8.4

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: 24b17d02a79c6444ee2aa04346e86ed6b41c480c
4
- data.tar.gz: 03a5b6d77c7234c56d8ab16e9b1673a11dbf51ac
3
+ metadata.gz: cfb1c23d2453ac01d0d60adf072758dc037c2a38
4
+ data.tar.gz: 8ee95f0a6eff6f7d28f740fb3de1a79e03e9cfe4
5
5
  SHA512:
6
- metadata.gz: 984cbf4bb275806d58553f3eb956b547d09667a04aaaeb040eebcf67c65681648dd00b28c0a02f0c35998359646309fa7500d53c23548289b3a2d80f5652a50f
7
- data.tar.gz: 1e30b68575f833b6ac9ff2b280216b1b51e57a13a8924c81b04ce0020472001d9f29bb50a901ca9a5c8bb92078b872028dc007848d8899b094ae723bd82225f3
6
+ metadata.gz: a650fd5858cc696e7377021a0e2672bae082d832f2844fef0aa822cbcf50ea521cd2cbb27bdf13d48500e0147225b36b60bbbc3868a53ee7a607b07f686a95e5
7
+ data.tar.gz: 29763f607715391ec02a1a299e5d85ba4a981529b2c5fe759995e174716412e67f47c818085c4a5a55c08849bcd1dc7072fe15dc89b0289b1140e8c2159cc7f8
@@ -37,18 +37,10 @@ module Fields
37
37
 
38
38
  private
39
39
 
40
- # For single asssociated instance (has_one association):
41
- # { name: ["can't be blank"], age: ["can't be less than 18"] }
42
- #
43
- # For multiple asssociated instances (has_many association):
44
40
  # { "xxx-xxxxxxxx-xxx-xxxxxx" => { name: ["can't be blank"], age: ["can't be less than 18"] },
45
41
  # "0" => { name: ["can't be blank"], age: ["can't be less than 18"] },
46
42
  def __associate_errors(associate)
47
- if associate.kind_of?(Array)
48
- associate.to_a.map.with_index { |object, i| [object.id || i, object.errors.to_h] }.to_h
49
- else
50
- associate.errors.to_h
51
- end
43
+ Array(associate).map.with_index { |object, i| [object.id || i, object.errors.to_h] }.to_h
52
44
  end
53
45
  end
54
46
  end
@@ -1,5 +1,5 @@
1
1
  module Fields
2
2
  module Serializer
3
- VERSION = "0.8.3"
3
+ VERSION = "0.8.4"
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.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stuart Chinery
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2018-03-25 00:00:00.000000000 Z
13
+ date: 2018-03-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler