Skip to content

Commit fce42f9

Browse files
committed
Fix rails/rack status code conversion
1 parent a84c706 commit fce42f9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

app/controllers/application_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def pundit_user
3737
def handle_error(status_code = 500, message = nil)
3838
status_code = (params[:status_code] || status_code) # params[:status_code] comes from routes for 500, 503, 422 and 404 errors
3939
if status_code.is_a?(Symbol) # Convert :forbidden, :not_found, etc. to 403, 404 etc.
40+
status_code = :unprocessable_content if status_code == :unprocessable_entity
4041
status_code = Rack::Utils::SYMBOL_TO_STATUS_CODE[status_code] || status_code
4142
end
4243

0 commit comments

Comments
 (0)