From e53f733966ab51560b3db513d2e343bf38be8258 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Thu, 9 Apr 2020 14:48:00 +0200 Subject: [PATCH] Eager-load addresses 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 8143df7ee2..680248e94f 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).includes(user: :credit_cards) + Customer.of(enterprise_id).includes(:bill_address, :ship_address, user: :credit_cards) end def load_managed_shops