Sha256: 2448211328d19097fbc61fd7932c5dc975c8076f17691a42c1d4affff0810d3e

Contents?: true

Size: 474 Bytes

Versions: 18

Compression:

Stored size: 474 Bytes

Contents

class AddShippingRatesToShipments < ActiveRecord::Migration
  def up
    Spree::Shipment.all.each do |shipment|
      shipment.shipping_rates.create(:shipping_method_id => shipment.shipping_method_id,
                                     :cost => shipment.cost,
                                     :selected => true)
    end

    remove_column :spree_shipments, :shipping_method_id
  end

  def down
    add_column :spree_shipments, :shipping_method_id, :integer
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
spree_core-2.2.0 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.1.5 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.9 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.1.4 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.8 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.1.3 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.7 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.1.2 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.6 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.1.1 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.5 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.1.0 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.4 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.3 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.2 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.1 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.0 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb
spree_core-2.0.0.rc1 db/migrate/20130417123427_add_shipping_rates_to_shipments.rb