From 7ecd67a3fee1579274ed726e89e00be24fec5320 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 4 Jun 2021 13:15:24 +0100 Subject: [PATCH] Skip orphaned adjustments There are a handful of enterprise fee adjustments on line items in production data where the line item has actually been deleted and no longer exists, but the fee adjustment is still in the database. --- db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb b/db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb index 570a2789bd..93cf62d095 100644 --- a/db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb +++ b/db/migrate/20210406161242_migrate_enterprise_fee_tax_amounts.rb @@ -72,7 +72,7 @@ class MigrateEnterpriseFeeTaxAmounts < ActiveRecord::Migration[5.0] return if enterprise_fee.nil? if line_item_fee?(fee) && enterprise_fee.inherits_tax_category? - fee.adjustable.product.tax_category + fee.adjustable&.product&.tax_category else enterprise_fee.tax_category end