Sha256: 495ab2dea69cf15765e99578d241b9985cd1792ccf676614cae73c3e3228b0e7
Contents?: true
Size: 491 Bytes
Versions: 7
Compression:
Stored size: 491 Bytes
Contents
# This migration comes from spree (originally 20101026184855) class RemoveShippedState < ActiveRecord::Migration def up execute "UPDATE orders SET state = 'complete' WHERE state = 'shipped'" shipments = select_all "SELECT shipments.id FROM shipments WHERE order_id IN (SELECT orders.id FROM orders WHERE orders.state = 'shipped')" shipments.each do |shipment| execute "UPDATE shipments SET state='shipped' WHERE id = #{shipment[:id]}" end end def down end end
Version data entries
7 entries across 7 versions & 2 rubygems