From e121a799ed041821db0e2695f2e96e752218f4d3 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 9 Dec 2025 12:10:21 +1100 Subject: [PATCH] Refer to unit from variant variant_unit was moved to variant as part of product refactor. Old products probably still had a value there, but new ones would have been appearing with nil. --- engines/dfc_provider/app/services/affiliate_sales_query.rb | 2 +- .../dfc_provider/spec/services/affiliate_sales_query_spec.rb | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/engines/dfc_provider/app/services/affiliate_sales_query.rb b/engines/dfc_provider/app/services/affiliate_sales_query.rb index a2a90ad233..155243745a 100644 --- a/engines/dfc_provider/app/services/affiliate_sales_query.rb +++ b/engines/dfc_provider/app/services/affiliate_sales_query.rb @@ -50,7 +50,7 @@ class AffiliateSalesQuery <<~SQL.squish spree_products.name AS product_name, spree_variants.display_name AS unit_name, - spree_products.variant_unit AS unit_type, + spree_variants.variant_unit AS unit_type, spree_variants.unit_value AS units, spree_variants.unit_presentation, spree_line_items.price, diff --git a/engines/dfc_provider/spec/services/affiliate_sales_query_spec.rb b/engines/dfc_provider/spec/services/affiliate_sales_query_spec.rb index b90b410576..40852fbae8 100644 --- a/engines/dfc_provider/spec/services/affiliate_sales_query_spec.rb +++ b/engines/dfc_provider/spec/services/affiliate_sales_query_spec.rb @@ -61,7 +61,6 @@ RSpec.describe AffiliateSalesQuery do it "returns data" do labelled_row = query.label_row(query.data(order1.distributor).first) - pending "unit_type" expect(labelled_row).to include( product_name: "Tomatoes", unit_name: "Tomatoes - Roma",