OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
eager load attachments to avoid n+1
ulferts737fd6ec9170
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.rbindex 9e08109a486..75c034b7a7e 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 ::IFCModelsbefore_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 :authorizemenu_item :ifc_modelsdef index- @ifc_models = @project- .ifc_models- .order('created_at ASC')- .includes(:uploader, :project)+ @ifc_models = @ifc_models+ .includes(:project, :uploader)enddef new@@ -116,6 +114,7 @@ module ::IFCModelsdef find_all_ifc_models@ifc_models = @project.ifc_models+ .includes(:attachments).order('created_at ASC')end