Sha256: f02e295c2af89b01cf5e0d08dd12cfacbfd65e53851f9140a46320648ed645a1

Contents?: true

Size: 492 Bytes

Versions: 9

Compression:

Stored size: 492 Bytes

Contents

# This migration comes from spree (originally 20130328130308)
class UpdateShipmentStateForCanceledOrders < ActiveRecord::Migration[4.2]
  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

9 entries across 9 versions & 2 rubygems

Version Path
spree_purchase_order-3.7.0 spec/dummy/db/migrate/20191113195761_update_shipment_state_for_canceled_orders.spree.rb
spree_billing_sisow-0.9.2 spec/dummy/db/migrate/20190729091702_update_shipment_state_for_canceled_orders.spree.rb
spree_billing_sisow-0.9.1 spec/dummy/db/migrate/20190729091702_update_shipment_state_for_canceled_orders.spree.rb
spree_purchase_order-3.6.0 spec/dummy/db/migrate/20180516181890_update_shipment_state_for_canceled_orders.spree.rb
spree_purchase_order-3.5.0 spec/dummy/db/migrate/20180516181890_update_shipment_state_for_canceled_orders.spree.rb
spree_purchase_order-3.5.0.rc1 spec/dummy/db/migrate/20180516181890_update_shipment_state_for_canceled_orders.spree.rb
spree_purchase_order-3.4.0 spec/dummy/db/migrate/20180516181890_update_shipment_state_for_canceled_orders.spree.rb
spree_purchase_order-3.3.0 spec/dummy/db/migrate/20180516181890_update_shipment_state_for_canceled_orders.spree.rb
spree_purchase_order-3.2.0 spec/dummy/db/migrate/20180516181890_update_shipment_state_for_canceled_orders.spree.rb