Sha256: 93cedbec9667d506cccf03507775c1eec7098fbee1d74b22b57d196c4d3c786c
Contents?: true
Size: 487 Bytes
Versions: 14
Compression:
Stored size: 487 Bytes
Contents
# This migration comes from spree (originally 20130328130308) class UpdateShipmentStateForCanceledOrders < ActiveRecord::Migration def up shipments = Spree::Shipment.joins(:order). where("spree_orders.state = 'canceled'") case Spree::Shipment.connection.adapter_name when "SQLite3" shipments.update_all("state = 'cancelled'") when "MySQL" || "PostgreSQL" shipments.update_all("spree_shipments.state = 'cancelled'") end end def down end end
Version data entries
14 entries across 14 versions & 7 rubygems