提交 b0506b08 编写于 作者: J Joshua Peek

Create separate middleware stack for initializer

上级 acfeec51
......@@ -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
......
......@@ -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
......
......@@ -5,8 +5,6 @@
require 'action_controller'
require 'rails/fcgi_handler'
Dispatcher.middleware.clear
class RailsFCGIHandlerTest < Test::Unit::TestCase
def setup
@log = StringIO.new
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册