Account for the possibility of a nil options argument to CompressedMemCacheStore#read/#write

This commit is contained in:
Jeffrey Hardy 2008-08-13 00:51:47 -04:00 committed by Jeremy Kemper
parent a5aad2e81f
commit 282b420213
1 changed files with 4 additions and 4 deletions

View File

@ -1,14 +1,14 @@
module ActiveSupport
module Cache
class CompressedMemCacheStore < MemCacheStore
def read(name, options = {})
if value = super(name, options.merge(:raw => true))
def read(name, options = nil)
if value = super(name, (options || {}).merge(:raw => true))
Marshal.load(ActiveSupport::Gzip.decompress(value))
end
end
def write(name, value, options = {})
super(name, ActiveSupport::Gzip.compress(Marshal.dump(value)), options.merge(:raw => true))
def write(name, value, options = nil)
super(name, ActiveSupport::Gzip.compress(Marshal.dump(value)), (options || {}).merge(:raw => true))
end
end
end