mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Fix sample data in v2 by setting a Default shipping category in both products and shipping methods
This commit is contained in:
@@ -74,8 +74,8 @@ class ProductFactory
|
||||
variant_unit: "weight",
|
||||
variant_unit_scale: 1,
|
||||
unit_value: 1,
|
||||
on_demand: true
|
||||
on_demand: true,
|
||||
shipping_category: Spree::ShippingCategory.find_or_create_by_name('Default')
|
||||
)
|
||||
Spree::Product.create_with(params).find_or_create_by_name!(params[:name])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -48,6 +48,7 @@ class ShippingMethodFactory
|
||||
params[:distributor_ids] = [enterprise.id]
|
||||
method = enterprise.shipping_methods.new(params)
|
||||
method.zone = zone
|
||||
method.shipping_categories << Spree::ShippingCategory.find_or_create_by_name('Default')
|
||||
method.save!
|
||||
method
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user