mirror of
https://github.com/github/rails.git
synced 2026-01-31 01:08:19 -05:00
Unrescued ActiveRecord::RecordNotFound responds with 404 instead of 500.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5706 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Unrescued ActiveRecord::RecordNotFound responds with 404 instead of 500. [Jeremy Kemper]
|
||||
|
||||
* Improved auto_link to match more valid urls correctly [Tobias Luetke]
|
||||
|
||||
* Add singleton resources. [Rick Olson]
|
||||
|
||||
@@ -11,7 +11,8 @@ module ActionController #:nodoc:
|
||||
DEFAULT_RESCUE_RESPONSE = :internal_server_error
|
||||
DEFAULT_RESCUE_RESPONSES = {
|
||||
'ActionController::RoutingError' => :not_found,
|
||||
'ActionController::UnknownAction' => :not_found
|
||||
'ActionController::UnknownAction' => :not_found,
|
||||
'ActiveRecord::RecordNotFound' => :not_found
|
||||
}
|
||||
|
||||
DEFAULT_RESCUE_TEMPLATE = 'diagnostics'
|
||||
|
||||
@@ -143,6 +143,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']
|
||||
end
|
||||
|
||||
def test_rescue_templates
|
||||
|
||||
Reference in New Issue
Block a user