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 +4 -4
- data/lib/json_api_responders/responder.rb +11 -3
- data/lib/json_api_responders/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3794bc90736ec72822b7e6fede32050da28652027b3a5199dd7fc49c57fd78f6
|
4
|
+
data.tar.gz: a154672fc186290a4de9354ad918d282838d691bec4f652d21c0aef487b13d28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
69
|
-
|
70
|
-
|
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
|
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.
|
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:
|
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
|
-
|
156
|
-
|
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: []
|