mirror of
https://github.com/github/rails.git
synced 2026-01-29 16:28:09 -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:
@@ -1,5 +1,7 @@
|
||||
*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 inGroupsOf and eachSlice to be called through rjs. #7046 [Cody Fauser]
|
||||
|
||||
@@ -16,7 +16,9 @@ module ActionController #:nodoc:
|
||||
'ActionController::RoutingError' => :not_found,
|
||||
'ActionController::UnknownAction' => :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'
|
||||
|
||||
@@ -141,7 +141,9 @@ 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']
|
||||
assert_equal :conflict, responses['ActiveRecord::StaleObjectError']
|
||||
assert_equal :unprocessable_entity, responses['ActiveRecord::RecordInvalid']
|
||||
assert_equal :unprocessable_entity, responses['ActiveRecord::RecordNotSaved']
|
||||
end
|
||||
|
||||
def test_rescue_templates
|
||||
|
||||
Reference in New Issue
Block a user