ignore reverse_order when finding in batches

Fixes https://github.com/rails/rails/issues/17854