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

ranked_in_list error when {:with_member_data => true, :include_missing => false} #60

Closed
dcampano opened this issue Jan 18, 2017 · 1 comment

Comments

@dcampano
Copy link
Contributor

I am testing upgrading from version 3.10.0 to 3.11.0 and came across an issue when using ranked_in_list with {:with_member_data => true, :include_missing => false}. The following code runs successfully on 3.10.0 but gets a "NoMethodError: undefined method `[]=' for nil:NilClass" on 3.11.0.

REDIS = Redis.new({:host => '127.0.0.1', :port => 6379, :db => 0})

leaderboard_name = 'testing'
opts = {:redis_connection => REDIS}
@leaderboard = Leaderboard.new(leaderboard_name, {:page_size => 7}, opts)
1.upto(100) do |n|
  @leaderboard.rank_member(n, n * 100)
  @leaderboard.update_member_data(n, "sample member data")
end

ids = [200, 201] #  ids don't exist in the leaderboard
@leaderboard.ranked_in_list(ids, {:with_member_data => true, :include_missing => false})
@dcampano
Copy link
Contributor Author

Working on a fix for this and will send a pull request.

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

No branches or pull requests

1 participant