diff options
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/middleware_stack.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_controller/middlewares.rb | 13 |
2 files changed, 7 insertions, 12 deletions
diff --git a/actionpack/lib/action_controller/middleware_stack.rb b/actionpack/lib/action_controller/middleware_stack.rb index dbc2fda41e..ee0ae48ac0 100644 --- a/actionpack/lib/action_controller/middleware_stack.rb +++ b/actionpack/lib/action_controller/middleware_stack.rb @@ -27,7 +27,9 @@ module ActionController end def klass - if @klass.is_a?(Class) + if @klass.respond_to?(:call) + @klass.call + elsif @klass.is_a?(Class) @klass else @klass.to_s.constantize @@ -37,6 +39,8 @@ module ActionController end def active? + return false unless klass + if @conditional.respond_to?(:call) @conditional.call else diff --git a/actionpack/lib/action_controller/middlewares.rb b/actionpack/lib/action_controller/middlewares.rb index 8ea1b5c7ce..fd70eca1b1 100644 --- a/actionpack/lib/action_controller/middlewares.rb +++ b/actionpack/lib/action_controller/middlewares.rb @@ -4,17 +4,8 @@ use "Rack::Lock", :if => lambda { use "ActionController::Failsafe" -["ActionController::Session::CookieStore", - "ActionController::Session::MemCacheStore", - "ActiveRecord::SessionStore"].each do |store| - use(store, ActionController::Base.session_options, - :if => lambda { - if session_store = ActionController::Base.session_store - session_store.name == store - end - } - ) -end +use lambda { ActionController::Base.session_store }, + ActionController::Base.session_options use "ActionController::RewindableInput" use "ActionController::ParamsParser" |