mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #3633 from mkllnk/remove-product-distribution-from-sample-data
Remove usage of ProductDistribution which is dead
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user