Skip to content

Instantly share code, notes, and snippets.

@wuputah
Created April 21, 2011 23:10
Show Gist options
  • Save wuputah/935690 to your computer and use it in GitHub Desktop.
Save wuputah/935690 to your computer and use it in GitHub Desktop.
while true
things = Thing.order("id DESC").limit(100)
things.each do |thing|
# stuff
end
things = Thing.order("id DESC").limit(100).where(["id < ?", things.last.id])
break if things.empty?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment