diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-09-26 13:41:32 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-09-26 13:41:32 -0500 |
commit | 1f7270057596592946a877cd029d95760ba3e5ee (patch) | |
tree | e891a72411b14502145073dda08ae8105e794295 /actionpack/lib/action_controller | |
parent | 71b33ec482404f6e48c651eb868243ed0b6c4175 (diff) | |
download | rails-1f7270057596592946a877cd029d95760ba3e5ee.tar.gz rails-1f7270057596592946a877cd029d95760ba3e5ee.tar.bz2 rails-1f7270057596592946a877cd029d95760ba3e5ee.zip |
Move default middleware stack into initializer
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/dispatch/dispatcher.rb | 5 | ||||
-rw-r--r-- | actionpack/lib/action_controller/dispatch/middlewares.rb | 16 |
2 files changed, 1 insertions, 20 deletions
diff --git a/actionpack/lib/action_controller/dispatch/dispatcher.rb b/actionpack/lib/action_controller/dispatch/dispatcher.rb index ba316b9e63..75b778a676 100644 --- a/actionpack/lib/action_controller/dispatch/dispatcher.rb +++ b/actionpack/lib/action_controller/dispatch/dispatcher.rb @@ -11,10 +11,7 @@ module ActionController self.router = Routing::Routes cattr_accessor :middleware - self.middleware = ActionDispatch::MiddlewareStack.new do |middleware| - middlewares = File.join(File.dirname(__FILE__), "middlewares.rb") - middleware.instance_eval(File.read(middlewares), middlewares, 1) - end + self.middleware = ActionDispatch::MiddlewareStack.new class << self def define_dispatcher_callbacks(cache_classes) diff --git a/actionpack/lib/action_controller/dispatch/middlewares.rb b/actionpack/lib/action_controller/dispatch/middlewares.rb deleted file mode 100644 index 5641b3cb8d..0000000000 --- a/actionpack/lib/action_controller/dispatch/middlewares.rb +++ /dev/null @@ -1,16 +0,0 @@ -use "Rack::Lock", :if => lambda { - !ActionController::Base.allow_concurrency -} - -use "ActionDispatch::ShowExceptions", lambda { ActionController::Base.consider_all_requests_local } -use "ActionDispatch::Callbacks", lambda { ActionController::Dispatcher.prepare_each_request } - -# TODO: Redirect global exceptions somewhere? -# use "ActionDispatch::Rescue" - -use lambda { ActionController::Base.session_store }, - lambda { ActionController::Base.session_options } - -use "ActionDispatch::ParamsParser" -use "Rack::MethodOverride" -use "Rack::Head" |