Created
May 20, 2009 18:23
-
-
Save whoahbot/114992 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def records_for(query) | |
set = @redis.set_members("#{query.model}:#{redis_key_for(query.model)}:all") | |
arr = Array.new(set.size) | |
set.each_with_index do |val, i| | |
arr[i] = {"#{redis_key_for(query.model)}" => val.to_i} | |
end | |
arr | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment