Browse files

Create separate middleware stack for initializer

  • Loading branch information...
1 parent acfeec5 commit b0506b086fa1b59b072aaf7de99f01846fce10a4 @josh josh committed Sep 26, 2009
View
5 railties/lib/rails/configuration.rb
@@ -108,10 +108,9 @@ def framework_root_path
defined?(::RAILS_FRAMEWORK_ROOT) ? ::RAILS_FRAMEWORK_ROOT : "#{root_path}/vendor/rails"
end
- # TODO: Fix this when there is an application object
def middleware
- require 'action_controller'
- ActionController::Dispatcher.middleware
+ require 'action_dispatch'
+ @middleware ||= ActionDispatch::MiddlewareStack.new
end
# Loads and returns the contents of the #database_configuration_file. The
View
1 railties/lib/rails/initializer.rb
@@ -608,6 +608,7 @@ def self.run(initializer = nil, config = nil)
Initializer.default.add :build_application do
if configuration.frameworks.include?(:action_controller)
+ ActionController::Dispatcher.middleware = configuration.middleware
Rails.application = Rails::Application.new
end
end
View
2 railties/test/fcgi_dispatcher_test.rb
@@ -5,8 +5,6 @@
require 'action_controller'
require 'rails/fcgi_handler'
-Dispatcher.middleware.clear
-
class RailsFCGIHandlerTest < Test::Unit::TestCase
def setup
@log = StringIO.new

0 comments on commit b0506b0

Please sign in to comment.