From 53e12fb5e52b39174cfd92d80e71c18c7197c551 Mon Sep 17 00:00:00 2001 From: jibees Date: Thu, 9 Dec 2021 11:12:23 +0100 Subject: [PATCH] Get rid of conditional branches with `&` operator Co-authored-by: Maikel --- app/controllers/concerns/checkout_callbacks.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/concerns/checkout_callbacks.rb b/app/controllers/concerns/checkout_callbacks.rb index bb620715a0..102fa5d185 100644 --- a/app/controllers/concerns/checkout_callbacks.rb +++ b/app/controllers/concerns/checkout_callbacks.rb @@ -42,8 +42,7 @@ module CheckoutCallbacks end def load_saved_credit_cards - @saved_credit_cards = [] if !spree_current_user - @saved_credit_cards = spree_current_user.credit_cards.with_payment_profile.all if spree_current_user + @saved_credit_cards = spree_current_user&.credit_cards&.with_payment_profile.to_a @selected_card = nil end