Sha256: 612ce92789d08c2a8916ce5714683d26ca25996769bc4cb92eb0d38279f91faf
Contents?: true
Size: 514 Bytes
Versions: 9
Compression:
Stored size: 514 Bytes
Contents
# This migration comes from spree (originally 20140601011216) class SetShipmentTotalForUsersUpgrading < ActiveRecord::Migration 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
9 entries across 9 versions & 4 rubygems