aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache
diff options
context:
space:
mode:
authorArthur Neves <arthurnn@gmail.com>2014-01-03 15:39:33 -0500
committerArthur Neves <arthurnn@gmail.com>2014-01-03 15:39:33 -0500
commit98458eea425d15ebadf366d8b55fc89c1913d146 (patch)
treed84e6121405db3ed34476febf75cc63b86dc8b7e /activesupport/lib/active_support/cache
parentf89266ace88b489a6af48fa4ae749a0e159112b6 (diff)
downloadrails-98458eea425d15ebadf366d8b55fc89c1913d146.tar.gz
rails-98458eea425d15ebadf366d8b55fc89c1913d146.tar.bz2
rails-98458eea425d15ebadf366d8b55fc89c1913d146.zip
mem_cache_store requires dalli, so only accept dalli/client
:mem_cache_store require dalli, rescue Dalli exceptions, and follow Dalli API. Memcached gem, for instance, doesnt work anymore, as the API are different. As we already require one client, we should make sure that client works, and not accept others, and if someone wants to use another memcache client they can write their own store adapter.
Diffstat (limited to 'activesupport/lib/active_support/cache')
-rw-r--r--activesupport/lib/active_support/cache/mem_cache_store.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb
index 512296554f..1ac4819d47 100644
--- a/activesupport/lib/active_support/cache/mem_cache_store.rb
+++ b/activesupport/lib/active_support/cache/mem_cache_store.rb
@@ -41,17 +41,12 @@ module ActiveSupport
#
# If no addresses are specified, then MemCacheStore will connect to
# localhost port 11211 (the default memcached port).
- #
- # Instead of addresses one can pass in a MemCache-like object. For example:
- #
- # require 'memcached' # gem install memcached; uses C bindings to libmemcached
- # ActiveSupport::Cache::MemCacheStore.new(Memcached::Rails.new("localhost:11211"))
def initialize(*addresses)
addresses = addresses.flatten
options = addresses.extract_options!
super(options)
- if addresses.first.respond_to?(:get)
+ if addresses.first.is_a?(Dalli::Client)
@data = addresses.first
else
mem_cache_options = options.dup