mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Get rid of conditional branches with & operator
Co-authored-by: Maikel <maikel@email.org.au>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user