diff options
author | Lourens Naude <lourens@methodmissing.com> | 2009-01-17 18:05:48 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-01-17 18:05:48 -0600 |
commit | b08c96887538cf53670bb882e79996582375e6c9 (patch) | |
tree | a124364059632725b7e40bf58dfb35afdf995dd6 /railties/lib | |
parent | 29e7a0242853a5e102b6846b87723fc26a1ffb08 (diff) | |
download | rails-b08c96887538cf53670bb882e79996582375e6c9.tar.gz rails-b08c96887538cf53670bb882e79996582375e6c9.tar.bz2 rails-b08c96887538cf53670bb882e79996582375e6c9.zip |
Decouple the local cache strategy from MemCacheStore for reuse with other remote stores [#1653 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/initializer.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index b57c46e098..f6b8899d58 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -414,8 +414,10 @@ Run `rake gems:install` to install the missing gems. def initialize_cache unless defined?(RAILS_CACHE) silence_warnings { Object.const_set "RAILS_CACHE", ActiveSupport::Cache.lookup_store(configuration.cache_store) } - if RAILS_CACHE.class.name == "ActiveSupport::Cache::MemCacheStore" - configuration.middleware.insert_after(:"ActionController::Failsafe", ActiveSupport::Cache::MemCacheStore::LocalCache) + + if RAILS_CACHE.respond_to?(:middleware) + # Insert middleware to setup and teardown local cache for each request + configuration.middleware.insert_after(:"ActionController::Failsafe", RAILS_CACHE.middleware) end end end |