From 019d4d7d6b32377d22fc7a8c48b71eb120f67764 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..4b8a4e989c4 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