Sha256: ec739559a70e7ff91139da0ea774f77a0c7be9a9e4191adaae3a42866c4b4084
Contents?: true
Size: 457 Bytes
Versions: 120
Compression:
Stored size: 457 Bytes
Contents
class SetShipmentTotalForUsersUpgrading < ActiveRecord::Migration[4.2] def up # NOTE You might not need this at all unless you're upgrading from Spree 2.1.x # or below. For those upgrading this should populate the Order#shipment_total # for legacy orders Spree::Order.complete.where('shipment_total = ?', 0).includes(:shipments).find_each do |order| order.update_column(:shipment_total, order.shipments.sum(:cost)) end end end
Version data entries
120 entries across 120 versions & 1 rubygems