From 71782de83abda5993edcedefaad2b771a23c5e73 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 10 Feb 2025 10:35:59 +1100 Subject: [PATCH] Apply suggestion from code review Co-authored-by: Maikel --- app/controllers/admin/dfc_product_imports_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/dfc_product_imports_controller.rb b/app/controllers/admin/dfc_product_imports_controller.rb index 897d374b49..0c545f37bf 100644 --- a/app/controllers/admin/dfc_product_imports_controller.rb +++ b/app/controllers/admin/dfc_product_imports_controller.rb @@ -43,9 +43,9 @@ module Admin catalog.apply_wholesale_values! # Import all selected products for given enterprise. - imported = catalog.products.select{ |subject| ids.include?(subject.semanticId) } - .map do |subject| - existing_variant = @enterprise.supplied_variants.linked_to(subject.semanticId) + imported = ids.map do |semantic_id| + subject = catalog.item(semantic_id) + existing_variant = @enterprise.supplied_variants.linked_to(semantic_id) if existing_variant SuppliedProductBuilder.update_product(subject, existing_variant)