mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
Support Ruby 2.4.
This commit is contained in:
@ -465,7 +465,7 @@ class ApplicationController < ActionController::Base
|
||||
# type - a machine-readable description of the error
|
||||
# status - HTTP status code to return
|
||||
def render_json_error(obj, opts={})
|
||||
opts = { status: opts } if opts.is_a?(Fixnum)
|
||||
opts = { status: opts } if opts.is_a?(Integer)
|
||||
render json: MultiJson.dump(create_errors_json(obj, opts[:type])), status: opts[:status] || 422
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user