aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-02-07 22:04:24 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-02-07 22:04:24 +0000
commit40f67639c814da3b04e234f8734f5afc1ea6a317 (patch)
tree226af931752d8210e161c12c0c372d91b5d0b7f0 /activesupport
parent3335bd12c8b3fbfe33ceda4b4f2f33ef023571da (diff)
downloadrails-40f67639c814da3b04e234f8734f5afc1ea6a317.tar.gz
rails-40f67639c814da3b04e234f8734f5afc1ea6a317.tar.bz2
rails-40f67639c814da3b04e234f8734f5afc1ea6a317.zip
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
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/cache/mem_cache_store.rb4
1 files changed, 2 insertions, 2 deletions
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