From 7948c5943d14b3736fda40a1b40be6bf2474b92a Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 1 May 2021 12:54:33 +0100 Subject: [PATCH] Remove #deleted? method from Product and Variant This method is already supplied via the paranoia gem, there's no need to re-implement it here. --- app/models/spree/product.rb | 7 ------- app/models/spree/variant.rb | 7 ------- 2 files changed, 14 deletions(-) diff --git a/app/models/spree/product.rb b/app/models/spree/product.rb index 6bd6cbc3dd..435b62221c 100755 --- a/app/models/spree/product.rb +++ b/app/models/spree/product.rb @@ -266,13 +266,6 @@ module Spree duplicator.duplicate end - # use deleted? rather than checking the attribute directly. this - # allows extensions to override deleted? if they want to provide - # their own definition. - def deleted? - !!deleted_at - end - # split variants list into hash which shows mapping of opt value onto matching variants # eg categorise_variants_from_option(color) => {"red" -> [...], "blue" -> [...]} def categorise_variants_from_option(opt_type) diff --git a/app/models/spree/variant.rb b/app/models/spree/variant.rb index 8268d78336..8be71b1252 100644 --- a/app/models/spree/variant.rb +++ b/app/models/spree/variant.rb @@ -166,13 +166,6 @@ module Spree OpenFoodNetwork::EnterpriseFeeCalculator.new(distributor, order_cycle).fees_by_type_for self end - # use deleted? rather than checking the attribute directly. this - # allows extensions to override deleted? if they want to provide - # their own definition. - def deleted? - deleted_at - end - def option_value(opt_name) option_values.detect { |o| o.option_type.name == opt_name }.try(:presentation) end