aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/mem_cache_store.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/cache/mem_cache_store.rb')
-rw-r--r--activesupport/lib/active_support/cache/mem_cache_store.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb
index bfe7e2ccf3..b3769b812f 100644
--- a/activesupport/lib/active_support/cache/mem_cache_store.rb
+++ b/activesupport/lib/active_support/cache/mem_cache_store.rb
@@ -48,7 +48,13 @@ module ActiveSupport
rescue MemCache::MemCacheError => e
logger.error("MemCacheError (#{e}): #{e.message}")
false
- end
+ end
+
+ def exist?(key, options = nil)
+ # Doesn't call super, cause exist? in memcache is in fact a read
+ # But who cares? Reading is very fast anyway
+ !read(key, options).nil?
+ end
def increment(key, amount = 1)
log("incrementing", key, amount)