Skip to content
This repository
Browse code

Support pluggable cache stores.

[#5486 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit 390d285ef67e1868aa0af6e86fa1cd59c32e926d 1 parent 730af48
Mike Perham authored jeremy committed
10  activesupport/CHANGELOG
... ...
@@ -1,3 +1,13 @@
  1
+*Rails 3.0.0 (unreleased)*
  2
+
  3
+* Pluggable cache stores: setting config.cache_store = "custom_store" will require 'active_support/cache/custom_store' and look for the CustomStore constant.  #5486 [Mike Perham]
  4
+
  5
+
  6
+*Rails 3.0.0 [release candidate 2] (August 23rd, 2010)*
  7
+
  8
+* No changes
  9
+
  10
+
1 11
 *Rails 3.0.0 [release candidate] (July 26th, 2010)*
2 12
 
3 13
 * Removed Object#returning, Object#tap should be used instead. [Santiago Pastorino]
9  activesupport/lib/active_support/cache.rb
@@ -58,7 +58,14 @@ def self.lookup_store(*store_option)
58 58
       case store
59 59
       when Symbol
60 60
         store_class_name = store.to_s.camelize
61  
-        store_class = ActiveSupport::Cache.const_get(store_class_name)
  61
+        store_class =
  62
+          begin
  63
+            require "active_support/cache/#{store}"
  64
+          rescue LoadError
  65
+            raise "Could not find cache store adapter for #{store} (#{$!})"
  66
+          else
  67
+            ActiveSupport::Cache.const_get(store_class_name)
  68
+          end
62 69
         store_class.new(*parameters)
63 70
       when nil
64 71
         ActiveSupport::Cache::MemoryStore.new

0 notes on commit 390d285

Please sign in to comment.
Something went wrong with that request. Please try again.