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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3d6ed2df617274528c05fb08ee2ffc179b035de
4
- data.tar.gz: e76161c601ac65f8a54b61ef64c20049af240031
3
+ metadata.gz: e00b4dccba7cdea4748d62a5a9badb4288ade864
4
+ data.tar.gz: b5b97f7d65410b1466a4bc80e796f9b6fae6fbb1
5
5
  SHA512:
6
- metadata.gz: 0f979f1b8ebd9a276ff054a20696d5fd77a9189ed3ea172f65ac790d320416cfb59ad0d9855359c577d7f453bd40655e660ef535dab45c80ede92458f63e9be0
7
- data.tar.gz: 74e5c1017860f0b7060217dc9051c794e52961dd1e7ede0e2e8e170d48f0316a4f95336477e76f84a29a417281ebee6bd6ed0d7e22a22d6226f0f4b50ac33387
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
- errors[e['meta']['attribute'].to_sym] = e['meta']['message']
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
@@ -1,3 +1,3 @@
1
1
  module JsonapiSpecHelpers
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  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.5
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-08-31 00:00:00.000000000 Z
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.6.11
141
+ rubygems_version: 2.5.1
142
142
  signing_key:
143
143
  specification_version: 4
144
144
  summary: Spec helpers for jsonapi