Skip to content

Instantly share code, notes, and snippets.

@hone
Forked from wuputah/things.rb
Created April 21, 2011 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hone/935693 to your computer and use it in GitHub Desktop.
Save hone/935693 to your computer and use it in GitHub Desktop.
things = Thing.order("id DESC").limit(100)
while things.any?
things.each do |thing|
# stuff
end
things = Thing.order("id DESC").limit(100).where(["id < ?", things.last.id])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment