aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorLourens Naude <lourens@methodmissing.com>2009-01-17 18:05:48 -0600
committerJoshua Peek <josh@joshpeek.com>2009-01-17 18:05:48 -0600
commitb08c96887538cf53670bb882e79996582375e6c9 (patch)
treea124364059632725b7e40bf58dfb35afdf995dd6 /railties/lib
parent29e7a0242853a5e102b6846b87723fc26a1ffb08 (diff)
downloadrails-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.rb6
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