Sha256: cc56d263fc9c00623a99718d8561e1720578f1fd227b4cb6b16eb15f870f9e85
Contents?: true
Size: 666 Bytes
Versions: 120
Compression:
Stored size: 666 Bytes
Contents
class IncreaseScaleOnPreTaxAmounts < ActiveRecord::Migration[4.2] def change # set pre_tax_amount on shipments to discounted_amount - included_tax_total # so that the null: false option on the shipment pre_tax_amount doesn't generate # errors. # execute(<<-SQL) UPDATE spree_shipments SET pre_tax_amount = (cost + promo_total) - included_tax_total WHERE pre_tax_amount IS NULL; SQL change_column :spree_line_items, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false change_column :spree_shipments, :pre_tax_amount, :decimal, precision: 12, scale: 4, default: 0.0, null: false end end
Version data entries
120 entries across 120 versions & 1 rubygems