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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfb1c23d2453ac01d0d60adf072758dc037c2a38
|
4
|
+
data.tar.gz: 8ee95f0a6eff6f7d28f740fb3de1a79e03e9cfe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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.
|
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-
|
13
|
+
date: 2018-03-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|