From bcdcb79ce3259a044458f05de93ff527dcec4bc7 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 24 Apr 2024 12:25:20 +0100 Subject: [PATCH] eager loading for files --- app/controllers/model_files_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/model_files_controller.rb b/app/controllers/model_files_controller.rb index 638523a12..d3d8e3a73 100644 --- a/app/controllers/model_files_controller.rb +++ b/app/controllers/model_files_controller.rb @@ -108,7 +108,7 @@ class ModelFilesController < ApplicationController end def get_file - @file = @model.model_files.find(params[:id]) + @file = @model.model_files.includes(:unsupported_version, :presupported_version).find(params[:id]) authorize @file @title = @file.name end