From 19895f087c338d8385dff9d272d30fb87cb10330 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Tue, 10 Jun 2008 10:29:25 +0100 Subject: Lazy load cache and session stores --- actionpack/lib/action_controller/session_management.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/session_management.rb b/actionpack/lib/action_controller/session_management.rb index 80a3ddd2c5..ad1013b379 100644 --- a/actionpack/lib/action_controller/session_management.rb +++ b/actionpack/lib/action_controller/session_management.rb @@ -1,10 +1,3 @@ -require 'action_controller/session/cookie_store' -require 'action_controller/session/drb_store' -require 'action_controller/session/mem_cache_store' -if Object.const_defined?(:ActiveRecord) - require 'action_controller/session/active_record_store' -end - module ActionController #:nodoc: module SessionManagement #:nodoc: def self.included(base) @@ -22,6 +15,8 @@ module ActionController #:nodoc: # :p_store, :drb_store, :mem_cache_store, or # :memory_store) or your own custom class. def session_store=(store) + require "action_controller/session/#{store.to_s}" if [:active_record_store, :drb_store, :mem_cache_store].include?(store) + ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] = store.is_a?(Symbol) ? CGI::Session.const_get(store == :drb_store ? "DRbStore" : store.to_s.camelize) : store end -- cgit v1.2.3