Guest User

Untitled

a guest
Jun 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. class << ActiveRecord::Base
  2. def each(limit=1000)
  3. rows = find(:all, :conditions => ["id > ?", 0], :limit => limit)
  4. while rows.any?
  5. rows.each { |record| yield record }
  6. rows = find(:all, :conditions => ["id > ?", rows.last.id], :limit => limit)
  7. end
  8. self
  9. end
  10. end
Add Comment
Please, Sign In to add comment