Skip to content

Commit

Permalink
Let ApplicationController stay unloaded for as long as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Nov 22, 2008
1 parent e50530c commit a026b4c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions actionpack/lib/action_controller/dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ def define_dispatcher_callbacks(cache_classes)
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 }
Expand Down Expand Up @@ -178,7 +176,7 @@ def handle_request

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
Expand Down

0 comments on commit a026b4c

Please sign in to comment.