captive-api 1.1.0 → 1.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e72b812dfba5731acc69f880513c4d445b6cc116ba1414769b7b2a80fe2ff059
|
4
|
+
data.tar.gz: 54aa16d8fef4481576db2a1b516370425028daeafdfba386ff39d59b76a554b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6ce7a15f9fe66265869f616b720d99b8adb4b2a4050db0a8cc86e61f8c8ab44dfa5de70d201a9dbac589b8f399ad909667bf605ac210347b331474253fa728b
|
7
|
+
data.tar.gz: e901f2a5e2e65a91f4f5602dd8528db230d73af5bc757eeb992c2bd7b2243c3136b56485d0f790656bf1433adb5f9342a50bbfe152c80fd328d1eab6aac65713
|
@@ -8,6 +8,7 @@ module Api
|
|
8
8
|
|
9
9
|
included do
|
10
10
|
rescue_from ActiveRecord::RecordNotFound, with: :not_found
|
11
|
+
rescue_from ActionController::ParameterMissing, with: :handle_parameter_missing
|
11
12
|
|
12
13
|
rescue_from CanCan::AccessDenied do |exception|
|
13
14
|
render_error_from_exception(exception, status: :forbidden)
|
@@ -23,7 +24,7 @@ module Api
|
|
23
24
|
errors = object.errors.messages
|
24
25
|
Rails.logger.error("Impossible de sauvagarder l'objet #{object.class} : #{errors}")
|
25
26
|
render_error(
|
26
|
-
message: message, errors: errors, status:
|
27
|
+
message: message, errors: errors, status: status
|
27
28
|
)
|
28
29
|
end
|
29
30
|
|
@@ -33,6 +34,10 @@ module Api
|
|
33
34
|
)
|
34
35
|
end
|
35
36
|
|
37
|
+
def handle_parameter_missing(exception)
|
38
|
+
render_error_from_exception(exception, status: :bad_request)
|
39
|
+
end
|
40
|
+
|
36
41
|
def not_found(exception)
|
37
42
|
render_error(message: "#{exception.model} not found", status: :not_found)
|
38
43
|
end
|
data/lib/captive/api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: captive-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Captive
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-07-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -64,7 +64,6 @@ homepage: https://www.captive.fr/
|
|
64
64
|
licenses:
|
65
65
|
- MIT
|
66
66
|
metadata:
|
67
|
-
allowed_push_host: https://rubygems.org/
|
68
67
|
homepage_uri: https://www.captive.fr/
|
69
68
|
source_code_uri: https://github.com/Captive-Studio/captive-api
|
70
69
|
post_install_message:
|