From 480bc9c75e81bca51a007c0d09894a9357442126 Mon Sep 17 00:00:00 2001 From: brchristian Date: Sun, 16 Aug 2020 09:43:12 -0700 Subject: [PATCH] Make payment.rb methods more concise --- core/app/models/spree/payment.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/app/models/spree/payment.rb b/core/app/models/spree/payment.rb index 85c9f753c1d..d6123eaa282 100644 --- a/core/app/models/spree/payment.rb +++ b/core/app/models/spree/payment.rb @@ -179,11 +179,11 @@ def validate_source end def source_required? - payment_method.present? && payment_method.source_required? + !!payment_method&.source_required? end def profiles_supported? - payment_method.respond_to?(:payment_profiles_supported?) && payment_method.payment_profiles_supported? + !!payment_method.try(:payment_profiles_supported?) end def create_payment_profile