Skip to content

Commit

Permalink
Fixes #17. Leaderboard not compatible with redis 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
David Czarnecki committed Jun 18, 2012
1 parent 202d980 commit 3ad63c8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.markdown
@@ -1,5 +1,9 @@
# CHANGELOG

## leaderboard 2.2.1 (2012-06-18)

* Fix for #17 - Leaderboard not compatible with redis 2.1.1. Redis' `zrangebyscore` and `zrevrangebyscore` methods do not return scores by default. No need to pass the option in the initial call.

## leaderboard 2.2.0 (2012-06-18)

* Added `members_from_score_range` and `members_from_score_range_in` methods. These will retrieve members from the leaderboard that fall within a given score range.
Expand Down
4 changes: 2 additions & 2 deletions lib/leaderboard.rb
Expand Up @@ -560,8 +560,8 @@ def members_from_score_range_in(leaderboard_name, minimum_score, maximum_score,
leaderboard_options.merge!(options)

raw_leader_data = @reverse ?
@redis_connection.zrangebyscore(leaderboard_name, minimum_score, maximum_score, :with_scores => false) :
@redis_connection.zrevrangebyscore(leaderboard_name, maximum_score, minimum_score, :with_scores => false)
@redis_connection.zrangebyscore(leaderboard_name, minimum_score, maximum_score) :
@redis_connection.zrevrangebyscore(leaderboard_name, maximum_score, minimum_score)

if raw_leader_data
return ranked_in_list_in(leaderboard_name, raw_leader_data, leaderboard_options)
Expand Down
2 changes: 1 addition & 1 deletion lib/leaderboard/version.rb
@@ -1,4 +1,4 @@
class Leaderboard
# Leaderboard version
VERSION = '2.2.0'.freeze
VERSION = '2.2.1'.freeze
end
2 changes: 1 addition & 1 deletion spec/version_spec.rb
Expand Up @@ -2,6 +2,6 @@

describe 'Leaderboard::VERSION' do
it 'should be the correct version' do
Leaderboard::VERSION.should == '2.2.0'
Leaderboard::VERSION.should == '2.2.1'
end
end

0 comments on commit 3ad63c8

Please sign in to comment.