From 03aa7877f7b3a0eb5ed1bb48a30be74194c4177a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 18 Apr 2010 23:01:44 -0700 Subject: MemoryStore#read_multi(*keys) for dev-mode compatibility with memcache store --- activesupport/lib/active_support/cache/memory_store.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/cache/memory_store.rb') diff --git a/activesupport/lib/active_support/cache/memory_store.rb b/activesupport/lib/active_support/cache/memory_store.rb index e6085d97ec..379922f986 100644 --- a/activesupport/lib/active_support/cache/memory_store.rb +++ b/activesupport/lib/active_support/cache/memory_store.rb @@ -21,6 +21,12 @@ module ActiveSupport @data = {} end + def read_multi(*names) + results = {} + names.each { |n| results[n] = read(n) } + results + end + def read(name, options = nil) super do @data[name] @@ -45,7 +51,7 @@ module ActiveSupport end end - def exist?(name,options = nil) + def exist?(name, options = nil) super do @data.has_key?(name) end -- cgit v1.2.3