Commit 2d40c22727fb097261643a9ee018458609800e46

Authored by Spencer Alan
1 parent 05df052c
Exists in master

rename json_response

app/controllers/concerns/scim_rails/exception_handler.rb
... ... @@ -10,19 +10,19 @@ module ScimRails
10 10  
11 11 included do
12 12 rescue_from ScimRails::ExceptionHandler::InvalidCredentials do
13   - scim_response({ message: "Invalid credentials" }, :unauthorized)
  13 + json_response({ message: "Invalid credentials" }, :unauthorized)
14 14 end
15 15  
16 16 rescue_from ScimRails::ExceptionHandler::MissingCredentials do
17   - scim_response({ message: "Missing credentials" }, :unauthorized)
  17 + json_response({ message: "Missing credentials" }, :unauthorized)
18 18 end
19 19  
20 20 rescue_from ActiveRecord::RecordNotFound do |e|
21   - scim_response({ message: e.message }, :not_found)
  21 + json_response({ message: e.message }, :not_found)
22 22 end
23 23  
24 24 rescue_from ActiveRecord::RecordInvalid do |e|
25   - scim_response({ message: e.message }, :unprocessable_entity)
  25 + json_response({ message: e.message }, :unprocessable_entity)
26 26 end
27 27 end
28 28 end
... ...
app/controllers/concerns/scim_rails/response.rb
1 1 module ScimRails
2 2 module Response
3   - def scim_response(object, status = :ok)
  3 + def json_response(object, status = :ok)
4 4 render(json: object, status: status)
5 5 end
6 6 end
... ...