diff --git a/lib/tasks/sample_data/product_factory.rb b/lib/tasks/sample_data/product_factory.rb index ba2bbfa208..0e13fa9762 100644 --- a/lib/tasks/sample_data/product_factory.rb +++ b/lib/tasks/sample_data/product_factory.rb @@ -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 diff --git a/lib/tasks/sample_data/shipping_method_factory.rb b/lib/tasks/sample_data/shipping_method_factory.rb index 87e3747781..27b27ce192 100644 --- a/lib/tasks/sample_data/shipping_method_factory.rb +++ b/lib/tasks/sample_data/shipping_method_factory.rb @@ -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