diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-02-19 21:21:34 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-02-19 21:21:34 -0600 |
commit | 9702636a08e50e9fed9bf76ad620a6a0a109009e (patch) | |
tree | bef0f974a77fb990527503ba8057f34ec09eca02 /actionpack/lib | |
parent | 3668a641702b6d0e5df963f54de8d17c53d6179c (diff) | |
download | rails-9702636a08e50e9fed9bf76ad620a6a0a109009e.tar.gz rails-9702636a08e50e9fed9bf76ad620a6a0a109009e.tar.bz2 rails-9702636a08e50e9fed9bf76ad620a6a0a109009e.zip |
Lazy evaluate ActionController session store middleware class to pickup custom plugin session stores [#2001 state:resolved]
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" |