diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-06-10 10:29:25 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-06-10 10:29:25 +0100 |
commit | 19895f087c338d8385dff9d272d30fb87cb10330 (patch) | |
tree | 1e62a24023e74bc996a7e27ac8eb086814fd3f20 /activesupport | |
parent | 225065709c43dacd57e0904aef2075024ccf2744 (diff) | |
download | rails-19895f087c338d8385dff9d272d30fb87cb10330.tar.gz rails-19895f087c338d8385dff9d272d30fb87cb10330.tar.bz2 rails-19895f087c338d8385dff9d272d30fb87cb10330.zip |
Lazy load cache and session stores
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/cache.rb | 9 | ||||
-rw-r--r-- | activesupport/lib/active_support/cache/drb_store.rb | 1 |
2 files changed, 4 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index 2f1143e610..07c83774df 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -7,10 +7,13 @@ 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 @@ -137,9 +140,3 @@ 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' diff --git a/activesupport/lib/active_support/cache/drb_store.rb b/activesupport/lib/active_support/cache/drb_store.rb index b80c2ee4d5..f06f08f566 100644 --- a/activesupport/lib/active_support/cache/drb_store.rb +++ b/activesupport/lib/active_support/cache/drb_store.rb @@ -1,4 +1,5 @@ require 'drb' +require 'active_support/cache/memory_store' module ActiveSupport module Cache |