Closed ivanovv closed 9 years ago
@ivanovv An interesting bug indeed! Thanks for the basics of the test case as well. Are you able to test that new commit to see if that fixes things for you?
Yeah, fixed for me :+1:
lb = TieRankingLeaderboard.new('zz')
lb.rank_members [1, 0.0, 2, 17543.0, 34, 0.0]
lb.leaders 1
[{:member=>"2", :score=>17543.0, :rank=>1}, {:member=>"34", :score=>0.0, :rank=>2}, {:member=>"1", :score=>0.0, :rank=>2}]
Thanks!
OK. I'll cut a new release tomorrow. I've got some other updates that I'm going to roll in as well.
First of all - thanks for a great gem!
Now, looks like there is a certain difference in behaviour between Leaderboard and TieRankingLeaderboard.
This is an expected behaviour - all members have rank, only I need members with equal score to have equal rank. So:
I would expect both members to have the same rank (1).
When the scores !=0 all members have a rank, but it is not 1, it is 2.
Any ideas?