Skip to content

Commit

Permalink
Account for the possibility of a nil options argument to CompressedMe…
Browse files Browse the repository at this point in the history
…mCacheStore#read/#write
  • Loading branch information
packagethief authored and jeremy committed Aug 13, 2008
1 parent a5aad2e commit 282b420
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 282b420

Please sign in to comment.