From 153d1309b7b3c1976d79f81f12a5830dec889f44 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Fri, 10 Dec 2021 14:28:05 +0100 Subject: [PATCH] Improve performance of repository cells index in the API [SCI-6348] --- app/controllers/api/v1/inventory_cells_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/inventory_cells_controller.rb b/app/controllers/api/v1/inventory_cells_controller.rb index 18e3245c9..cd93ebaac 100644 --- a/app/controllers/api/v1/inventory_cells_controller.rb +++ b/app/controllers/api/v1/inventory_cells_controller.rb @@ -12,7 +12,7 @@ module Api def index cells = @inventory_item.repository_cells - .preload(value: @inventory.cell_preload_includes) + .preload(:repository_column, value: @inventory.cell_preload_includes) .page(params.dig(:page, :number)) .per(params.dig(:page, :size)) render jsonapi: cells, each_serializer: InventoryCellSerializer