Skip to content

Commit

Permalink
Merge pull request #3633 from mkllnk/remove-product-distribution-from…
Browse files Browse the repository at this point in the history
…-sample-data

Remove usage of ProductDistribution which is dead
  • Loading branch information
sauloperez authored Mar 22, 2019
2 parents 4595ea0 + 0b7192b commit deec4f8
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions lib/tasks/sample_data/product_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,6 @@ def create_product(hash)
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

0 comments on commit deec4f8

Please sign in to comment.