mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-15 23:57:48 +00:00
Fix sample_data by filtering params for products
We were passing too many parameters to the product creation. Rails 5.2 complained that products don't have a distributor. Filtering the parameters helps.
This commit is contained in:
@@ -60,7 +60,7 @@ module SampleData
|
||||
|
||||
def create_product(hash)
|
||||
log "- #{hash[:name]}"
|
||||
params = hash.merge(
|
||||
params = hash.slice(:name, :price).merge(
|
||||
supplier_id: hash[:supplier].id,
|
||||
primary_taxon_id: hash[:taxons].first.id,
|
||||
variant_unit: "weight",
|
||||
|
||||
Reference in New Issue
Block a user