mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Update soft-delete of variants
Spree changed their way of soft-deleting variants from calling `delete` to calling `destroy`. We don't need our own implementation any more.
This commit is contained in:
@@ -105,14 +105,6 @@ Spree::Variant.class_eval do
|
||||
OpenFoodNetwork::EnterpriseFeeCalculator.new(distributor, order_cycle).fees_by_type_for self
|
||||
end
|
||||
|
||||
def delete
|
||||
transaction do
|
||||
self.update_column(:deleted_at, Time.zone.now)
|
||||
ExchangeVariant.where(variant_id: self).destroy_all
|
||||
self
|
||||
end
|
||||
end
|
||||
|
||||
def refresh_products_cache
|
||||
if is_master?
|
||||
product.refresh_products_cache
|
||||
|
||||
@@ -6,7 +6,7 @@ class VariantDeleter
|
||||
return false
|
||||
end
|
||||
|
||||
variant.delete
|
||||
variant.destroy
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user