Sha256: deaf7a65e4d0c4c2643674dfd447260ee666082e9ad1397ce04fb8d352b287a7
Contents?: true
Size: 589 Bytes
Versions: 34
Compression:
Stored size: 589 Bytes
Contents
class RenameAdjustmentFields < ActiveRecord::Migration[4.2] def up remove_column :spree_adjustments, :originator_id remove_column :spree_adjustments, :originator_type add_column :spree_adjustments, :order_id, :integer unless column_exists?(:spree_adjustments, :order_id) # This enables the Spree::Order#all_adjustments association to work correctly Spree::Adjustment.reset_column_information Spree::Adjustment.where(adjustable_type: "Spree::Order").find_each do |adjustment| adjustment.update_column(:order_id, adjustment.adjustable_id) end end end
Version data entries
34 entries across 34 versions & 2 rubygems