Rails 7.1 adds support for multi-column ordering in ActiveRecord::Batches - BigBinary Blog
04-Oct-2023 559
In Rails versions prior to 7.1, when batch processing records with a composite primary key, like id_1 and id_2, developers could use the :asc or :desc argument to control the sorting order. However, there was a limitation in how this sorting worked. When you specified the sorting order using :asc or :desc, it affected both id_1 and id_2 simultaneously. In other words, if you requested ascending order, both id_1 and id_2 would be sorted in ascending order together. Similarly, if you requested descending order, both id_1 and id_2 would be sorted in descending order together.This limitation had practical implications, especially when you needed to sort records by different criteria for each part of the composite primary key.
Rails 7.1 adds support for multi-column ordering in ActiveRecord::Batches - BigBinary Blog #ruby #rubydeveloper #rubyonrails #Rails #support #multi-column #ordering #ActiveRecord::Batches #BigBinary #activerecord::batches #bigbinary #blog https://rubyonrails.ba/link/rails-7-1-adds-support-for-multi-column-ordering-in-activerecord-batches-bigbinary-blog