mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use 400 Bad Request status for unrescued ActiveRecord::RecordInvalid exceptions.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5771 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
bc3d150386
commit
a1ca37ec86
3 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Use 400 Bad Request status for unrescued ActiveRecord::RecordInvalid exceptions. [Jeremy Kemper]
|
||||
|
||||
* Silence log_error deprecation warnings from inspecting deprecated instance variables. [Nate Wiger]
|
||||
|
||||
* Only cache GET requests with a 200 OK response. #6514, #6743 [RSL, anamba]
|
||||
|
|
|
@ -12,7 +12,8 @@ module ActionController #:nodoc:
|
|||
DEFAULT_RESCUE_RESPONSES = {
|
||||
'ActionController::RoutingError' => :not_found,
|
||||
'ActionController::UnknownAction' => :not_found,
|
||||
'ActiveRecord::RecordNotFound' => :not_found
|
||||
'ActiveRecord::RecordNotFound' => :not_found,
|
||||
'ActiveRecord::RecordInvalid' => :bad_request
|
||||
}
|
||||
|
||||
DEFAULT_RESCUE_TEMPLATE = 'diagnostics'
|
||||
|
|
|
@ -144,6 +144,7 @@ class RescueTest < Test::Unit::TestCase
|
|||
assert_equal :not_found, responses[ActionController::RoutingError.name]
|
||||
assert_equal :not_found, responses[ActionController::UnknownAction.name]
|
||||
assert_equal :not_found, responses['ActiveRecord::RecordNotFound']
|
||||
assert_equal :bad_request, responses['ActiveRecord::RecordInvalid']
|
||||
end
|
||||
|
||||
def test_rescue_templates
|
||||
|
|
Loading…
Reference in a new issue