Skip to content

Instantly share code, notes, and snippets.

@whoahbot
Created May 20, 2009 18:23
Show Gist options
  • Save whoahbot/114992 to your computer and use it in GitHub Desktop.
Save whoahbot/114992 to your computer and use it in GitHub Desktop.
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