1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Don't duplicate Rack::Response functionality. [#5320 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
John Firebaugh 2010-08-06 11:24:09 -07:00 committed by José Valim
parent c509379923
commit 308517e913

View file

@ -15,29 +15,15 @@ module ActionDispatch
end
# Was the response successful?
def success?
(200..299).include?(response_code)
end
alias_method :success?, :successful?
# Was the URL not found?
def missing?
response_code == 404
end
alias_method :missing?, :not_found?
# Were we redirected?
def redirect?
(300..399).include?(response_code)
end
alias_method :redirect?, :redirection?
# Was there a server-side error?
def error?
(500..599).include?(response_code)
end
alias_method :server_error?, :error?
# Was there a client client?
def client_error?
(400..499).include?(response_code)
end
alias_method :error?, :server_error?
end
end