Get rid of conditional branches with & operator

Co-authored-by: Maikel <maikel@email.org.au>
This commit is contained in:
jibees
2021-12-09 11:12:23 +01:00
committed by GitHub
parent 3c491299fd
commit 53e12fb5e5

View File

@@ -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