Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix add_namespace methods in case of nested array args #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

1 participant