mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Revert "Lazy load cache and session stores"
This reverts commit 19895f087c
.
This commit is contained in:
parent
a3caf28da3
commit
6573f6a4bc
5 changed files with 14 additions and 8 deletions
|
@ -1,3 +1,10 @@
|
|||
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)
|
||||
|
@ -15,8 +22,6 @@ module ActionController #:nodoc:
|
|||
# <tt>:p_store</tt>, <tt>:drb_store</tt>, <tt>:mem_cache_store</tt>, or
|
||||
# <tt>:memory_store</tt>) 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
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
require 'fileutils'
|
||||
require 'abstract_unit'
|
||||
require "active_support/cache/memory_store"
|
||||
|
||||
CACHE_DIR = 'test_cache'
|
||||
# Don't change '/../temp/' cavalierly or you might hose something you don't want hosed
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'abstract_unit'
|
||||
require 'action_controller/cgi_process'
|
||||
require 'action_controller/cgi_ext'
|
||||
require 'action_controller/session/mem_cache_store'
|
||||
|
||||
|
||||
class CGI::Session
|
||||
def cache
|
||||
|
|
|
@ -7,13 +7,10 @@ module ActiveSupport
|
|||
|
||||
case store
|
||||
when Symbol
|
||||
require "active_support/cache/#{store.to_s}"
|
||||
|
||||
store_class_name = (store == :drb_store ? "DRbStore" : store.to_s.camelize)
|
||||
store_class = ActiveSupport::Cache.const_get(store_class_name)
|
||||
store_class.new(*parameters)
|
||||
when nil
|
||||
require "active_support/cache/memory_store"
|
||||
ActiveSupport::Cache::MemoryStore.new
|
||||
else
|
||||
store
|
||||
|
@ -140,3 +137,9 @@ module ActiveSupport
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
require 'active_support/cache/file_store'
|
||||
require 'active_support/cache/memory_store'
|
||||
require 'active_support/cache/drb_store'
|
||||
require 'active_support/cache/mem_cache_store'
|
||||
require 'active_support/cache/compressed_mem_cache_store'
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require 'drb'
|
||||
require 'active_support/cache/memory_store'
|
||||
|
||||
module ActiveSupport
|
||||
module Cache
|
||||
|
|
Loading…
Reference in a new issue