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 call to migrate. #1593

Closed
wants to merge 1 commit into from
Closed

Fix call to migrate. #1593

wants to merge 1 commit into from

Conversation

badboy
Copy link
Contributor

@badboy badboy commented Mar 11, 2014

The redis-rb client takes the additional info as an options hash, not as additional arguments.

I'm using redis-rb v3.0.7, which takes only two arguments, see https://github.com/redis/redis-rb/blob/master/lib/redis.rb#L399
I couldn't find the code that it ever took 5 arguments, so I think this code in redis-trib.rb should have never worked.

The redis-rb client takes the additional info as an options hash, not as additional arguments.
@antirez
Copy link
Contributor

antirez commented Mar 11, 2014

That's strange, with v 3.0.7 works well. Is it possible that it depends on the Ruby version used?

@antirez
Copy link
Contributor

antirez commented Mar 11, 2014

I mean, 3.0.3

@badboy
Copy link
Contributor Author

badboy commented Mar 11, 2014

I see. Support for MIGRATE was added only in 3.0.5¹, before that it relied on method_missing, which just passes all arguments down.

¹: redis/redis-rb@3e7277d

@antirez
Copy link
Contributor

antirez commented Mar 11, 2014

Oh, that's pretty terrible. Thanks @badboy. It means that basically there is no way to patch it if not to use a check for the method existence. Please could you rework the patch so that it uses respond_to? :migrate to switch between the two behavior?

@antirez
Copy link
Contributor

antirez commented Mar 11, 2014

(or I can do myself, I asked you to commit the change since you discovered how it works :-)

antirez added a commit that referenced this pull request Mar 11, 2014
…anges.

See issue #1593.

Thanks to @badboy for suggesting the direct client.call fix.
@badboy badboy closed this Mar 12, 2014
@badboy badboy deleted the patch-6 branch March 12, 2014 12:30
antirez added a commit that referenced this pull request Mar 15, 2014
…anges.

See issue #1593.

Thanks to @badboy for suggesting the direct client.call fix.
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

2 participants