From 8c8942ed4f2da52aa42ccd46560acb0b5fd37cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 14 Jan 2010 19:53:07 +0100 Subject: Move Dispatcher setup to Railties and add instrumentation hook. --- actionpack/lib/action_controller/railtie.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_controller/railtie.rb') diff --git a/actionpack/lib/action_controller/railtie.rb b/actionpack/lib/action_controller/railtie.rb index d4886ecefd..741101a210 100644 --- a/actionpack/lib/action_controller/railtie.rb +++ b/actionpack/lib/action_controller/railtie.rb @@ -69,12 +69,12 @@ module ActionController app.config.middleware.insert_before(:"ActionDispatch::ParamsParser", middleware) end - # # Prepare dispatcher callbacks and run 'prepare' callbacks + # Prepare dispatcher callbacks and run 'prepare' callbacks initializer "action_controller.prepare_dispatcher" do |app| # TODO: This used to say unless defined?(Dispatcher). Find out why and fix. + # Notice that at this point, ActionDispatch::Callbacks were already loaded. require 'rails/dispatcher' - - Dispatcher.define_dispatcher_callbacks(app.config.cache_classes) + ActionController::Dispatcher.prepare_each_request = true unless app.config.cache_classes unless app.config.cache_classes # Setup dev mode route reloading @@ -85,7 +85,7 @@ module ActionController app.reload_routes! end end - ActionDispatch::Callbacks.before_dispatch { |callbacks| reload_routes.call } + ActionDispatch::Callbacks.before { |callbacks| reload_routes.call } end end -- cgit v1.2.3