From fec2b0b7c15e1891ffc697d86b19b6b4457fbd69 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 17 Mar 2021 16:48:38 +0000 Subject: [PATCH] Define models in migration --- .../20210224190247_migrate_shipping_taxes.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/db/migrate/20210224190247_migrate_shipping_taxes.rb b/db/migrate/20210224190247_migrate_shipping_taxes.rb index 963cfe6107..f305de7862 100644 --- a/db/migrate/20210224190247_migrate_shipping_taxes.rb +++ b/db/migrate/20210224190247_migrate_shipping_taxes.rb @@ -1,4 +1,21 @@ class MigrateShippingTaxes < ActiveRecord::Migration + class Spree::Preference < ActiveRecord::Base; end + class Spree::TaxCategory < ActiveRecord::Base; end + class Spree::ShippingMethod < ActiveRecord::Base; end + class Spree::Zone < ActiveRecord::Base; end + class Spree::TaxRate < ActiveRecord::Base + belongs_to :zone, class_name: "Spree::Zone", inverse_of: :tax_rates + belongs_to :tax_category, class_name: "Spree::TaxCategory", inverse_of: :tax_rates + has_one :calculator, class_name: "Spree::Calculator", as: :calculable, dependent: :destroy + accepts_nested_attributes_for :calculator + end + class Spree::Adjustment < ActiveRecord::Base + belongs_to :adjustable, polymorphic: true + belongs_to :originator, polymorphic: true + belongs_to :source, polymorphic: true + belongs_to :order, class_name: "Spree::Order" + end + def up return unless instance_uses_shipping_tax?