Merge pull request #3680 from kristinalim/fix/3285-db_migration_bang_shipping_rates

[Spree Upgrade] Bang version of create in DB migration for shipping rates
This commit is contained in:
Pau Pérez Fabregat
2019-04-05 15:11:41 +02:00
committed by GitHub

View File

@@ -2,9 +2,9 @@
class AddShippingRatesToShipments < ActiveRecord::Migration
def up
Spree::Shipment.all.each do |shipment|
shipment.shipping_rates.create(:shipping_method_id => shipment.shipping_method_id,
:cost => shipment.cost,
:selected => true)
shipment.shipping_rates.create!(:shipping_method_id => shipment.shipping_method_id,
:cost => shipment.cost,
:selected => true)
end
remove_column :spree_shipments, :shipping_method_id