From d38417fc02bc12f1182c0821eda6b58ef3b8ca5a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 17 Jan 2007 00:43:53 +0000 Subject: 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 --- actionpack/lib/action_controller/rescue.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/rescue.rb b/actionpack/lib/action_controller/rescue.rb index ca85ef34d0..9f94e076c7 100644 --- a/actionpack/lib/action_controller/rescue.rb +++ b/actionpack/lib/action_controller/rescue.rb @@ -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' -- cgit v1.2.3