From 2a8809e6e8fed014ed7be093f4e7d99be5f73a42 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 9 Apr 2020 14:06:49 +0200 Subject: [PATCH] Eager-load default card in customer serializer --- app/controllers/admin/customers_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/customers_controller.rb b/app/controllers/admin/customers_controller.rb index 902b458dab..8143df7ee2 100644 --- a/app/controllers/admin/customers_controller.rb +++ b/app/controllers/admin/customers_controller.rb @@ -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