diff --git a/engines/dfc_provider/app/services/variant_fetcher.rb b/engines/dfc_provider/app/services/variant_fetcher.rb index e99eb8dd02..df3fd86f82 100644 --- a/engines/dfc_provider/app/services/variant_fetcher.rb +++ b/engines/dfc_provider/app/services/variant_fetcher.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -# Service used to fetch variants related to an entreprise. +# Service used to fetch variants related to an enterprise. # It improves maintenance as it is the central point requesting # Spree::Variant inside the DfcProvider engine. class VariantFetcher @@ -10,7 +10,7 @@ class VariantFetcher def scope Spree::Variant.not_master. - joins(product: :supplier). - where('enterprises.id' => @enterprise.id) + joins(:product). + where(spree_products: { supplier: @enterprise }) end end