jsonapi_spec_helpers 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jsonapi_spec_helpers/helpers.rb +8 -1
- data/lib/jsonapi_spec_helpers/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e00b4dccba7cdea4748d62a5a9badb4288ade864
|
4
|
+
data.tar.gz: b5b97f7d65410b1466a4bc80e796f9b6fae6fbb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 808157161143b7296aebdf4632f4d6e8be14f09a55d46b4bab0f33e1100c09004688783da9f5270d74506b0ec283edcbdb2be97c54ab7194e1abc7677b330176
|
7
|
+
data.tar.gz: 24323e0a411d7a18b9b90d23680533314e29ab34d3388e18e5e3a6e2a841d590545706b612858dee8d176d055ee61208f0d6dc9acdaae74ddf68de20e7f3bd8e
|
@@ -57,7 +57,14 @@ module JsonapiSpecHelpers
|
|
57
57
|
def validation_errors
|
58
58
|
@validation_errors ||= {}.tap do |errors|
|
59
59
|
json['errors'].each do |e|
|
60
|
-
|
60
|
+
attr = e['meta']['attribute'].to_sym
|
61
|
+
message = e['meta']['message']
|
62
|
+
|
63
|
+
if errors[attr]
|
64
|
+
errors[attr] = Array(errors[attr]).push(message)
|
65
|
+
else
|
66
|
+
errors[attr] = message
|
67
|
+
end
|
61
68
|
end
|
62
69
|
end
|
63
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi_spec_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.5.1
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: Spec helpers for jsonapi
|