Created
February 12, 2012 19:21
-
-
Save arfon/1810357 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
results = ActiveRecord::Base.connection.execute("select light_curve_id from classifications where zooniverse_user_id=#{user.id}") | |
results.each { |r| ids << r.first } | |
ids_to_process = ids.flatten.uniq | |
require 'enumerator' | |
unless ids.empty? | |
ids.each_slice(1000) do |a| | |
RedisConnect.redis.sadd("zooniverse_user_#{user.id}", *a) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment