aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/middleware_stack.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-02-19 21:21:34 -0600
committerJoshua Peek <josh@joshpeek.com>2009-02-19 21:21:34 -0600
commit9702636a08e50e9fed9bf76ad620a6a0a109009e (patch)
treebef0f974a77fb990527503ba8057f34ec09eca02 /actionpack/lib/action_controller/middleware_stack.rb
parent3668a641702b6d0e5df963f54de8d17c53d6179c (diff)
downloadrails-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/action_controller/middleware_stack.rb')
-rw-r--r--actionpack/lib/action_controller/middleware_stack.rb6
1 files changed, 5 insertions, 1 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