db/samples/shipping_methods.rb in spree_sample-2.0.13 vs db/samples/shipping_methods.rb in spree_sample-2.1.0

- old
+ new

@@ -5,40 +5,40 @@ puts "That task will set up the countries, states and zones required for Spree." exit end europe_vat = Spree::Zone.find_by_name!("EU_VAT") -shipping_category = Spree::ShippingCategory.find_by_name!("Default") +shipping_category = Spree::ShippingCategory.find_or_create_by!(name: 'Default') shipping_methods = [ { :name => "UPS Ground (USD)", :zones => [north_america], - :calculator => Spree::Calculator::Shipping::FlatRate.create!, + :calculator => Spree::Calculator::FlatRate.create!, :shipping_categories => [shipping_category] }, { :name => "UPS Two Day (USD)", :zones => [north_america], - :calculator => Spree::Calculator::Shipping::FlatRate.create!, + :calculator => Spree::Calculator::FlatRate.create!, :shipping_categories => [shipping_category] }, { :name => "UPS One Day (USD)", :zones => [north_america], - :calculator => Spree::Calculator::Shipping::FlatRate.create!, + :calculator => Spree::Calculator::FlatRate.create!, :shipping_categories => [shipping_category] }, { :name => "UPS Ground (EUR)", :zones => [europe_vat], - :calculator => Spree::Calculator::Shipping::FlatRate.create!, + :calculator => Spree::Calculator::FlatRate.create!, :shipping_categories => [shipping_category] } ] shipping_methods.each do |shipping_method_attrs| - Spree::ShippingMethod.create!(shipping_method_attrs, :without_protection => true) + Spree::ShippingMethod.create!(shipping_method_attrs) end { "UPS Ground (USD)" => [5, "USD"], "UPS Ground (EUR)" => [5, "EUR"],