mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-24 05:38:52 +00:00
Merge pull request #6679 from Matt-Yorkley/soft-delete-enterprise-fees
Soft-delete Enterprise Fees
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user