mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Use exists? method to avoid unnecesary loading of credit card array
This commit is contained in:
@@ -32,7 +32,7 @@ Spree::CreditCard.class_eval do
|
||||
private
|
||||
|
||||
def default_missing?
|
||||
user.credit_cards.where(is_default: true).none?
|
||||
!user.credit_cards.exists?(is_default: true)
|
||||
end
|
||||
|
||||
def ensure_default
|
||||
|
||||
Reference in New Issue
Block a user