mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Let ApplicationController stay unloaded for as long as possible
This commit is contained in:
@@ -12,8 +12,6 @@ module ActionController
|
||||
after_dispatch :cleanup_application
|
||||
end
|
||||
|
||||
to_prepare(:load_application_controller) { ApplicationController }
|
||||
|
||||
if defined?(ActiveRecord)
|
||||
after_dispatch :checkin_connections
|
||||
to_prepare(:activerecord_instantiate_observers) { ActiveRecord::Base.instantiate_observers }
|
||||
@@ -178,7 +176,7 @@ module ActionController
|
||||
|
||||
def failsafe_rescue(exception)
|
||||
self.class.failsafe_response(@output, '500 Internal Server Error', exception) do
|
||||
if @controller ||= defined?(::ApplicationController) ? ::ApplicationController : Base
|
||||
if @controller ||= (::ApplicationController rescue Base)
|
||||
@controller.process_with_exception(@request, @response, exception).out(@output)
|
||||
else
|
||||
raise exception
|
||||
|
||||
Reference in New Issue
Block a user