Merge pull request #6679 from Matt-Yorkley/soft-delete-enterprise-fees

Soft-delete Enterprise Fees
This commit is contained in:
Matt-Yorkley
2021-01-21 19:57:29 +01:00
committed by GitHub
5 changed files with 36 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
class EnterpriseFee < ActiveRecord::Base
include Spree::Core::CalculatedAdjustments
acts_as_paranoid
belongs_to :enterprise
belongs_to :tax_category, class_name: 'Spree::TaxCategory', foreign_key: 'tax_category_id'

View File

@@ -162,6 +162,13 @@ module Spree
result
end
# Allow accessing soft-deleted originator objects
def originator
return if originator_type.blank?
originator_type.constantize.unscoped { super }
end
private
def update_adjustable