Avoid ternary operator

This commit is contained in:
Jean-Baptiste Bellet
2021-11-25 15:27:52 +01:00
committed by Matt-Yorkley
parent f9b0798c88
commit 68e4d55f80

View File

@@ -42,7 +42,8 @@ module CheckoutCallbacks
end
def load_saved_credit_cards
@saved_credit_cards = spree_current_user ? spree_current_user.credit_cards.with_payment_profile.all : []
@saved_credit_cards = [] if !spree_current_user
@saved_credit_cards = spree_current_user.credit_cards.with_payment_profile.all if spree_current_user
@selected_card = nil
end