Skip to content

Commit

Permalink
Forward new Hash, not nil, when options are unset
Browse files Browse the repository at this point in the history
  • Loading branch information
tvjg committed Sep 24, 2016
1 parent f0abef4 commit f780220
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/redis/store/namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def del(*keys)
end

def mget(*keys)
options = keys.pop if keys.last.is_a? Hash
options = (keys.pop if keys.last.is_a? Hash) || {}
if keys.any?
# Marshalling gets extended before Namespace does, so we need to pass options further
if singleton_class.ancestors.include? Marshalling
Expand Down
4 changes: 3 additions & 1 deletion test/redis/store/marshalling_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def teardown

it "doesn't unmarshal on multi get" do
@store.set "rabbit2", @white_rabbit
rabbit, rabbit2 = @store.mget "rabbit", "rabbit2"
rabbits = @store.mget "rabbit", "rabbit2"
rabbit, rabbit2 = rabbits
rabbits.length.must_equal(2)
rabbit.must_equal(@rabbit)
rabbit2.must_equal(@white_rabbit)
end
Expand Down

0 comments on commit f780220

Please sign in to comment.