Find_each passing colum to order

Hello everyone

Has someone tried to implement in find_each the order column? Right now only order using the primary key but if your primary key is a uuid this method won’t work well.

The idea is to allow find_each to order by the column that you specify and by default using the primary key if you haven’t specified anything.

Not sure if someone has tried it before, is it something that could be merged if I create a PR?

Cheers, Alfonso

1 Like

Waaaaay back in the Rails 2.x days Michael Grosser had put together a sample – the first comment found here.

I’ve created this PR Allow `order_column` in querying batch methods by AlfonsoUceda · Pull Request #46696 · rails/rails · GitHub