From 0b7192b82a1bba32d8e404933d1da7d99acf788b Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 21 Mar 2019 17:31:43 +1100 Subject: [PATCH] Remove usage of ProductDistribution which is dead Sample data was failing since: https://github.com/openfoodfoundation/openfoodnetwork/pull/3570 --- lib/tasks/sample_data/product_factory.rb | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/tasks/sample_data/product_factory.rb b/lib/tasks/sample_data/product_factory.rb index 260ddb49cc..ba2bbfa208 100644 --- a/lib/tasks/sample_data/product_factory.rb +++ b/lib/tasks/sample_data/product_factory.rb @@ -76,18 +76,6 @@ class ProductFactory unit_value: 1, on_demand: true ) - create_product_with_distribution(params, hash[:supplier]) - end - - def create_product_with_distribution(params, supplier) - product = Spree::Product.create_with(params).find_or_create_by_name!(params[:name]) - - distribution_params = { - distributor_id: params[:distributor].id, - enterprise_fee_id: supplier.enterprise_fees.first.id - } - ProductDistribution.create_with(distribution_params).find_or_create_by_product_id!(product.id) - - product + Spree::Product.create_with(params).find_or_create_by_name!(params[:name]) end end