How can I use ordering as it is?
Any help will be appreciated. Thank u!
see the code-
selected_catalog_products.find_in_batches(batch_size: 4) do |cps|
# my code
end
How can I use ordering as it is?
Any help will be appreciated. Thank u!
see the code-
selected_catalog_products.find_in_batches(batch_size: 4) do |cps|
# my code
end
It’s not possible to set the order. That is automatically set to ascending on the primary key (“id ASC”) to make the batch ordering work.
http://apidock.com/rails/ActiveRecord/Batches/find_in_batches