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

Version Path
spree_weight_calculator-0.1.0 test/dummy/db/migrate/20160723192483_update_shipment_state_for_canceled_orders.spree.rb
spree_order_reporting-0.0.3 spec/dummy/db/migrate/20160708163080_update_shipment_state_for_canceled_orders.spree.rb
spree_order_reporting-0.0.2 spec/dummy/db/migrate/20160707103404_update_shipment_state_for_canceled_orders.spree.rb
spree_order_reporting-0.0.1 spec/dummy/db/migrate/20160706112356_update_shipment_state_for_canceled_orders.spree.rb
sprangular-0.1.0 spec/dummy/db/migrate/20140814105682_update_shipment_state_for_canceled_orders.spree.rb
sprangular-0.0.1 spec/dummy/db/migrate/20140814105682_update_shipment_state_for_canceled_orders.spree.rb
spree_mercado_pago-0.2.3 spec/dummy/db/migrate/20141204014675_update_shipment_state_for_canceled_orders.spree.rb
spree_mercado_pago-0.2.2 spec/dummy/db/migrate/20141204014675_update_shipment_state_for_canceled_orders.spree.rb
spree_mercado_pago-0.2.1 spec/dummy/db/migrate/20141112193458_update_shipment_state_for_canceled_orders.spree.rb
spree_mercado_pago-0.2.0 spec/dummy/db/migrate/20141112193458_update_shipment_state_for_canceled_orders.spree.rb
spree_mercado_pago_payment_method-0.2.0 spec/dummy/db/migrate/20141112193458_update_shipment_state_for_canceled_orders.spree.rb
spree_bitpay-1.0.2 spec/dummy/db/migrate/20141002181255_update_shipment_state_for_canceled_orders.spree.rb
bcms_spree-0.0.2 test/dummy/db/migrate/20140915222594_update_shipment_state_for_canceled_orders.spree.rb
bcms_spree-0.0.1 test/dummy/db/migrate/20140915222594_update_shipment_state_for_canceled_orders.spree.rb