This blog is part of our Rails 5 series.
In Rails 4.x we had
start option in
The above code provides batches of
Person starting from record whose value of
primary key is equal to 1000.
There is no end value for primary key. That means in the above case all the records that have primary key value greater than 1000 are fetched.
Rails 5 introduces finish option that serves as an upper limit to the primary key value in the records being fetched.
The above code ensures that no record in any of the batches has the primary key value greater than 9500.