mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-24 05:38:52 +00:00
Merge pull request #3634 from luisramos0/2-0-fix-sample-data
[Spree Upgrade] Fix new sample data in v2
This commit is contained in:
@@ -74,8 +74,10 @@ class ProductFactory
|
||||
variant_unit: "weight",
|
||||
variant_unit_scale: 1,
|
||||
unit_value: 1,
|
||||
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])
|
||||
product = Spree::Product.create_with(params).find_or_create_by_name!(params[:name])
|
||||
product.variants.first.update_attribute :on_demand, true
|
||||
product
|
||||
end
|
||||
end
|
||||
|
||||
@@ -47,7 +47,8 @@ class ShippingMethodFactory
|
||||
def create_shipping_method(enterprise, params)
|
||||
params[:distributor_ids] = [enterprise.id]
|
||||
method = enterprise.shipping_methods.new(params)
|
||||
method.zone = zone
|
||||
method.zones << zone
|
||||
method.shipping_categories << Spree::ShippingCategory.find_or_create_by_name('Default')
|
||||
method.save!
|
||||
method
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user