From 94d71b8dcea7e251191305329fe05d607dd766e7 Mon Sep 17 00:00:00 2001 From: Cillian O'Ruanaidh Date: Wed, 8 Jun 2022 20:02:43 +0100 Subject: [PATCH] Remove extra unnecessary :display_on_checkout scope and reuse :frontend scope instead --- app/helpers/enterprises_helper.rb | 2 +- app/models/spree/shipping_method.rb | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/helpers/enterprises_helper.rb b/app/helpers/enterprises_helper.rb index a93eb56b24..e535e9a7ba 100644 --- a/app/helpers/enterprises_helper.rb +++ b/app/helpers/enterprises_helper.rb @@ -16,7 +16,7 @@ module EnterprisesHelper def available_shipping_methods return [] if current_distributor.blank? - shipping_methods = current_distributor.shipping_methods.display_on_checkout.to_a + shipping_methods = current_distributor.shipping_methods.frontend.to_a applicator = OpenFoodNetwork::TagRuleApplicator.new(current_distributor, "FilterShippingMethods", current_customer&.tag_list) diff --git a/app/models/spree/shipping_method.rb b/app/models/spree/shipping_method.rb index 042d7d07a0..4e9fe38825 100644 --- a/app/models/spree/shipping_method.rb +++ b/app/models/spree/shipping_method.rb @@ -55,9 +55,6 @@ module Spree } scope :by_name, -> { order('spree_shipping_methods.name ASC') } - scope :display_on_checkout, -> { - where("spree_shipping_methods.display_on is null OR spree_shipping_methods.display_on = ''") - } # Here we allow checkout with shipping methods without zones (see issue #3928 for details) # and also checkout with addresses outside of the zones of the selected shipping method