diff options
author | Carl Lerche <carllerche@mac.com> | 2010-03-03 21:16:35 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-03-03 21:24:27 -0800 |
commit | 15b3b74624eb4c5ae383956950cab12ca9899131 (patch) | |
tree | 7a8c5cf8044d79a7656abff25c080e06e7423d4c /actionpack/lib/action_controller/metal/session_management.rb | |
parent | 1f0f05b10c924d2f0d0ff4c74cbd979e77deea1d (diff) | |
download | rails-15b3b74624eb4c5ae383956950cab12ca9899131.tar.gz rails-15b3b74624eb4c5ae383956950cab12ca9899131.tar.bz2 rails-15b3b74624eb4c5ae383956950cab12ca9899131.zip |
Fix all the broken tests due to the AC configuration refactor
Diffstat (limited to 'actionpack/lib/action_controller/metal/session_management.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/session_management.rb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/metal/session_management.rb b/actionpack/lib/action_controller/metal/session_management.rb index 09ef9261a4..ce8b20964b 100644 --- a/actionpack/lib/action_controller/metal/session_management.rb +++ b/actionpack/lib/action_controller/metal/session_management.rb @@ -3,24 +3,28 @@ module ActionController #:nodoc: extend ActiveSupport::Concern included do - self.config.session_store ||= :cookie_store + # This is still needed for the session secret for some reason. self.config.session_options ||= {} end + def self.session_store_for(store) + case store + when :active_record_store + ActiveRecord::SessionStore + when Symbol + ActionDispatch::Session.const_get(store.to_s.camelize) + else + store + end + end + module ClassMethods def session_options config.session_options end def session_store - case store = config.session_store - when :active_record_store - ActiveRecord::SessionStore - when Symbol - ActionDispatch::Session.const_get(store.to_s.camelize) - else - store - end + SessionManagement.session_store_for(config.session_store) end def session=(options = {}) |