From 956c4a27c221e7ba07287f73715f48261debff37 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 17 Feb 2026 14:43:18 +1100 Subject: [PATCH] Remove unnecessary guard clause Previously, payment actions that were listed without an associated `can_?` method were interpreted as supported. All payment methods are implementing all `can_?` methods for listed actions though. And I think that new payment methods should explicitely implement all `can_?` methods instead of relying on this hidden logic. --- app/models/spree/payment.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/spree/payment.rb b/app/models/spree/payment.rb index f397c43106..7953d71a3c 100644 --- a/app/models/spree/payment.rb +++ b/app/models/spree/payment.rb @@ -155,8 +155,7 @@ module Spree return [] unless payment_method.respond_to?(:actions) payment_method.actions.select do |action| - !payment_method.respond_to?("can_#{action}?") || - payment_method.__send__("can_#{action}?", self) + payment_method.__send__("can_#{action}?", self) end end