unepwcmc/SAPI

View on GitHub
app/services/checklist/index_fetcher.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Checklist::IndexFetcher
  def initialize(relation)
    @relation = relation
    @limit = 5000
    @offset = 0
  end

  def next
    results = @relation.limit(@limit).offset(@offset)
    @offset += @limit
    results
  end
end