mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user