I am iterating through a large array of model objects and need to paginate for performance/memory reasons.
I want to do something like this:
for i in 1..Person.num_pages
Person.page(i).each do
# work
end
end
Obviously I can get the count and do the math myself, but is there an equivalent of num_pages? Or is there a more elegant way of doing this altogether?
num_pages
has been renamed tototal_pages
in version 0.14.0 (commit) – Knownothing