From 0bef762cc746aff6c02fd7c5edf28b15265ca968 Mon Sep 17 00:00:00 2001 From: Nick Van Doorn Date: Fri, 26 Jan 2024 14:40:12 -0800 Subject: [PATCH] Remove order by sku from variant scope This "fixes" the variant scope issue but I'm not sure it's the solution we want. I suppose it depends if ordering by sku is important here. Co-authored-by: An Stewart (cherry picked from commit c4bd75a78a812d45c7784e2bb21e471ecc7574c9) --- backend/app/controllers/spree/admin/stock_items_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/controllers/spree/admin/stock_items_controller.rb b/backend/app/controllers/spree/admin/stock_items_controller.rb index 7669a41f19c..8750bc9ca71 100644 --- a/backend/app/controllers/spree/admin/stock_items_controller.rb +++ b/backend/app/controllers/spree/admin/stock_items_controller.rb @@ -56,7 +56,7 @@ def load_stock_management_data def variant_scope scope = Spree::Variant .accessible_by(current_ability) - .distinct.order(:sku) + .distinct .includes( :images, stock_items: :stock_location,