diff --git a/modules/ifc_models/app/controllers/ifc_models/ifc_models_controller.rb b/modules/ifc_models/app/controllers/ifc_models/ifc_models_controller.rb index 9e08109a48..75c034b7a7 100644 --- a/modules/ifc_models/app/controllers/ifc_models/ifc_models_controller.rb +++ b/modules/ifc_models/app/controllers/ifc_models/ifc_models_controller.rb @@ -34,17 +34,15 @@ module ::IFCModels before_action :find_project_by_project_id, only: %i[index new create show show_defaults edit update destroy] before_action :find_ifc_model_object, except: %i[index new create] - before_action :find_all_ifc_models, only: %i[show show_defaults] + before_action :find_all_ifc_models, only: %i[show show_defaults index] before_action :authorize menu_item :ifc_models def index - @ifc_models = @project - .ifc_models - .order('created_at ASC') - .includes(:uploader, :project) + @ifc_models = @ifc_models + .includes(:project, :uploader) end def new @@ -116,6 +114,7 @@ module ::IFCModels def find_all_ifc_models @ifc_models = @project .ifc_models + .includes(:attachments) .order('created_at ASC') end