json_api_responders 2.5.0 → 2.6.0

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
  SHA256:
3
- metadata.gz: 68ccd56fc5fea80e2c23da7f8fe3360cba3472eeefaf203994f819019336c7f4
4
- data.tar.gz: 741f758a79c1b81d542f30ba8adc17f04ed3e776cff43c9b11f9765b62aaef4f
3
+ metadata.gz: 3794bc90736ec72822b7e6fede32050da28652027b3a5199dd7fc49c57fd78f6
4
+ data.tar.gz: a154672fc186290a4de9354ad918d282838d691bec4f652d21c0aef487b13d28
5
5
  SHA512:
6
- metadata.gz: 663b35d9cd5ebafb31dac2aa7578a56f28beb410df8442b1621dcc5ead2f4da13ffc2f085fd3d96dac6f20ebf1db91459239da292510796427a27359c233002f
7
- data.tar.gz: 43c72b652cb2aef3e97215870a3bb01b2d001e9577cb60c141cfb9d366909465024c47367f37e912e330896023ca60361edd8a342425a63061557da9275aba22
6
+ metadata.gz: 1c71f1a4ce435cdb8d5cdbfeae05c1a822ee4e253d1a30184c000de7d9e1c3e9731042950d53bb9a844637fc47b664011859475a07b49a2d85b4b01ff77ab752
7
+ data.tar.gz: 44c54e7096f25bd0b8f40f25c005be086f9015acfb4b427be22eaa83f8483f02473c0f92b8cfa6f6d0b2dfa27c32e6b4c8e2fad0540f2d916fac6fdbf094e590
@@ -65,9 +65,17 @@ module JsonApiResponders
65
65
 
66
66
  errors[:errors] << { detail: on_error(:detail) } if on_error(:detail)
67
67
 
68
- resource.errors.each do |attribute, message|
69
- errors[:errors] << error_response(attribute, message)
70
- end if resource.respond_to?(:errors)
68
+ if resource.respond_to?(:errors)
69
+ if ActiveModel.version >= Gem::Version.new("6.1")
70
+ resource.errors.each do |error|
71
+ errors[:errors] << error_response(error.attribute, error.message)
72
+ end
73
+ else
74
+ resource.errors.each do |attribute, message|
75
+ errors[:errors] << error_response(attribute, message)
76
+ end
77
+ end
78
+ end
71
79
 
72
80
  errors
73
81
  end
@@ -1,6 +1,6 @@
1
1
  module JsonApiResponders
2
2
  MAJOR = 2
3
- MINOR = 5
3
+ MINOR = 6
4
4
  PATCH = 0
5
5
  VERSION = [MAJOR, MINOR, PATCH].join('.').freeze
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_api_responders
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanko Krtalić Rusendić
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-16 00:00:00.000000000 Z
11
+ date: 2021-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -137,7 +137,7 @@ homepage: https://github.com/infinum/json_api_responders
137
137
  licenses: []
138
138
  metadata:
139
139
  allowed_push_host: https://rubygems.org
140
- post_install_message:
140
+ post_install_message:
141
141
  rdoc_options: []
142
142
  require_paths:
143
143
  - lib
@@ -152,9 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  requirements: []
155
- rubyforge_project:
156
- rubygems_version: 2.7.3
157
- signing_key:
155
+ rubygems_version: 3.0.3
156
+ signing_key:
158
157
  specification_version: 4
159
158
  summary: Automatically respond to JSON::API requests
160
159
  test_files: []