From 40f67639c814da3b04e234f8734f5afc1ea6a317 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 7 Feb 2008 22:04:24 +0000 Subject: Fix that the options hash can be nil when coming from fragments git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8818 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/cache/mem_cache_store.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb index 5312271330..3fd9f37cce 100644 --- a/activesupport/lib/active_support/cache/mem_cache_store.rb +++ b/activesupport/lib/active_support/cache/mem_cache_store.rb @@ -31,9 +31,9 @@ module ActiveSupport # Set key = value if key isn't already set. Pass :force => true # to unconditionally set key = value. Returns a boolean indicating # whether the key was set. - def write(key, value, options = {}) + def write(key, value, options = nil) super - method = options[:force] ? :set : :add + method = options && options[:force] ? :set : :add response = @data.send(method, key, value, expires_in(options), raw?(options)) response == Response::STORED rescue MemCache::MemCacheError => e -- cgit v1.2.3