Improve performance of repository cells index in the API [SCI-6348]

This commit is contained in:
Oleksii Kriuchykhin 2021-12-10 14:28:05 +01:00
parent 9ff71ad651
commit 153d1309b7

View file

@ -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