Eager-load default card in customer serializer

This commit is contained in:
Matt-Yorkley
2020-04-09 14:06:49 +02:00
parent 31a54e49c5
commit 2a8809e6e8

View File

@@ -67,7 +67,7 @@ module Admin
enterprise_id = Enterprise.managed_by(spree_current_user).
select('enterprises.id').find_by_id(params[:enterprise_id])
Customer.of(enterprise_id)
Customer.of(enterprise_id).includes(user: :credit_cards)
end
def load_managed_shops