mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-05 22:26:07 +00:00
Update unscoping of deleted_at on originator association
This commit is contained in:
@@ -38,7 +38,7 @@ module Spree
|
||||
|
||||
belongs_to :adjustable, polymorphic: true
|
||||
belongs_to :source, polymorphic: true
|
||||
belongs_to :originator, polymorphic: true
|
||||
belongs_to :originator, -> { with_deleted }, polymorphic: true
|
||||
belongs_to :order, class_name: "Spree::Order"
|
||||
|
||||
belongs_to :tax_rate, -> { where spree_adjustments: { originator_type: 'Spree::TaxRate' } },
|
||||
@@ -142,13 +142,6 @@ module Spree
|
||||
included_tax.positive?
|
||||
end
|
||||
|
||||
# Allow accessing soft-deleted originator objects
|
||||
def originator
|
||||
return if originator_type.blank?
|
||||
|
||||
originator_type.constantize.unscoped { super }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def update_adjustable_adjustment_total
|
||||
|
||||
Reference in New Issue
Block a user