Skip to content

fix add_namespace methods in case of nested array args#109

Open
lastcat wants to merge 1 commit intoresque:masterfrom
lastcat:fix_for_hmset
Open

fix add_namespace methods in case of nested array args#109
lastcat wants to merge 1 commit intoresque:masterfrom
lastcat:fix_for_hmset

Conversation

@lastcat
Copy link

@lastcat lastcat commented Oct 12, 2015

redis_namespace unsupported hmset of array args.
ex:

redis = Redis.new
namespaced = Redis::Namespace.new(:named, redis: redis)

namespaced.hmset(["key","hoge","fuga","piyo","poyo"])
puts namespaced.hgetall("key")
redis.hmset(["key","hoge","fuga","piyo","poyo"])
puts redis.hgetall("key")

output is

{"named:hoge"=>"named:fuga", "named:piyo"=>"named:poyo"}
{"hoge"=>"fuga", "piyo"=>"poyo"}

The unexpected behavior reason why is that add_namespacemethod is not considered about nested array args. But redis-rb gem support it. I think interface between these gems are same is better, so added flatten process for nested array args. It is confirmed that this change is to pass all tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant