Sha256: 2492d4915dc9f1d0f72b97e3ba31884bb3f8426e7dae2acd8e8f8250811371f9

Contents?: true

Size: 409 Bytes

Versions: 9

Compression:

Stored size: 409 Bytes

Contents

# This migration comes from spree (originally 20130802022321)
class MigrateTaxCategoriesToLineItems < ActiveRecord::Migration[4.2]
  def change
    Spree::LineItem.find_each do |line_item|
      next if line_item.variant.nil?
      next if line_item.variant.product.nil?
      next if line_item.product.nil?
      line_item.update_column(:tax_category_id, line_item.product.tax_category_id)
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
spree_purchase_order-3.7.0 spec/dummy/db/migrate/20191113195790_migrate_tax_categories_to_line_items.spree.rb
spree_billing_sisow-0.9.2 spec/dummy/db/migrate/20190729091731_migrate_tax_categories_to_line_items.spree.rb
spree_billing_sisow-0.9.1 spec/dummy/db/migrate/20190729091731_migrate_tax_categories_to_line_items.spree.rb
spree_purchase_order-3.6.0 spec/dummy/db/migrate/20180516181919_migrate_tax_categories_to_line_items.spree.rb
spree_purchase_order-3.5.0 spec/dummy/db/migrate/20180516181919_migrate_tax_categories_to_line_items.spree.rb
spree_purchase_order-3.5.0.rc1 spec/dummy/db/migrate/20180516181919_migrate_tax_categories_to_line_items.spree.rb
spree_purchase_order-3.4.0 spec/dummy/db/migrate/20180516181919_migrate_tax_categories_to_line_items.spree.rb
spree_purchase_order-3.3.0 spec/dummy/db/migrate/20180516181919_migrate_tax_categories_to_line_items.spree.rb
spree_purchase_order-3.2.0 spec/dummy/db/migrate/20180516181919_migrate_tax_categories_to_line_items.spree.rb