From 4ef682915cbcaecda64f139b39574d2946c2d0aa Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 5 Nov 2019 15:53:06 +0000 Subject: [PATCH] Eager-load option_values in Admin::EnterprisesController --- app/controllers/admin/enterprises_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/enterprises_controller.rb b/app/controllers/admin/enterprises_controller.rb index 3f62509eb0..4d91fd2e70 100644 --- a/app/controllers/admin/enterprises_controller.rb +++ b/app/controllers/admin/enterprises_controller.rb @@ -148,7 +148,8 @@ module Admin unless enterprises.empty? enterprises.includes( - supplied_products: [:supplier, :variants, master: [:images]] + supplied_products: + [:supplier, master: [:images], variants: { option_values: :option_type }] ) end when :index