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
This commit is contained in:
David Heinemeier Hansson 2008-02-07 22:04:24 +00:00
parent 3335bd12c8
commit 40f67639c8
1 changed files with 2 additions and 2 deletions

View File

@ -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