agoragames / leaderboard

Leaderboards backed by Redis in Ruby
https://rubygems.org/gems/leaderboard
MIT License
478 stars 65 forks source link

ranked_in_list is not sorted by rank #29

Closed agerlic closed 11 years ago

agerlic commented 11 years ago

ranked_in_list is not sorted by rank:

eg (with 2.5.0):

HIGHSCORE_LB.rank_member("id1", 200) HIGHSCORE_LB.rank_member("id2", 100) HIGHSCORE_LB.rank_member("id3", 300) HIGHSCORE_LB.ranked_in_list(["id1", "id2", "id3"]) => [{:member=>"id1", :rank=>2, :score=>200.0}, {:member=>"id2", :rank=>3, :score=>100.0}, {:member=>"id3", :rank=>1, :score=>300.0}]

czarneckid commented 11 years ago

This has been the behavior of that method from the beginning as it was intended to be used to retrieve an arbitrary list of members from the leaderboard in no particular order. I can clarify that as the behavior in the code and in the README.

I may look at modifying the behavior to return the list, sorted by rank, in version 3 of the library.