mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
RecordInvalid, RecordNotSaved => 422 Unprocessable Entity, StaleObjectError => 409 Conflict. References #7097.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5966 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
b0a1aa7e7e
commit
d38417fc02
3 changed files with 8 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
||||||
*SVN*
|
*SVN*
|
||||||
|
|
||||||
|
* RecordInvalid, RecordNotSaved => 422 Unprocessable Entity, StaleObjectError => 409 Conflict. #7097 [dkubb]
|
||||||
|
|
||||||
* Allow fields_for to be nested inside form_for, so that the name and id get properly constructed [Jamis Buck]
|
* Allow fields_for to be nested inside form_for, so that the name and id get properly constructed [Jamis Buck]
|
||||||
|
|
||||||
* Allow inGroupsOf and eachSlice to be called through rjs. #7046 [Cody Fauser]
|
* Allow inGroupsOf and eachSlice to be called through rjs. #7046 [Cody Fauser]
|
||||||
|
|
|
@ -16,7 +16,9 @@ module ActionController #:nodoc:
|
||||||
'ActionController::RoutingError' => :not_found,
|
'ActionController::RoutingError' => :not_found,
|
||||||
'ActionController::UnknownAction' => :not_found,
|
'ActionController::UnknownAction' => :not_found,
|
||||||
'ActiveRecord::RecordNotFound' => :not_found,
|
'ActiveRecord::RecordNotFound' => :not_found,
|
||||||
'ActiveRecord::RecordInvalid' => :bad_request
|
'ActiveRecord::StaleObjectError' => :conflict,
|
||||||
|
'ActiveRecord::RecordInvalid' => :unprocessable_entity,
|
||||||
|
'ActiveRecord::RecordNotSaved' => :unprocessable_entity
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFAULT_RESCUE_TEMPLATE = 'diagnostics'
|
DEFAULT_RESCUE_TEMPLATE = 'diagnostics'
|
||||||
|
|
|
@ -141,7 +141,9 @@ class RescueTest < Test::Unit::TestCase
|
||||||
assert_equal :not_found, responses[ActionController::RoutingError.name]
|
assert_equal :not_found, responses[ActionController::RoutingError.name]
|
||||||
assert_equal :not_found, responses[ActionController::UnknownAction.name]
|
assert_equal :not_found, responses[ActionController::UnknownAction.name]
|
||||||
assert_equal :not_found, responses['ActiveRecord::RecordNotFound']
|
assert_equal :not_found, responses['ActiveRecord::RecordNotFound']
|
||||||
assert_equal :bad_request, responses['ActiveRecord::RecordInvalid']
|
assert_equal :conflict, responses['ActiveRecord::StaleObjectError']
|
||||||
|
assert_equal :unprocessable_entity, responses['ActiveRecord::RecordInvalid']
|
||||||
|
assert_equal :unprocessable_entity, responses['ActiveRecord::RecordNotSaved']
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_rescue_templates
|
def test_rescue_templates
|
||||||
|
|
Loading…
Reference in a new issue