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
Query::Results: move common joins into `work_package_scope`
Sebastian Fiedlschuster63a55ec24a7a
diff --git a/app/models/query/results.rb b/app/models/query/results.rbindex 22e2229c822..b6e2ab1aa00 100644--- a/app/models/query/results.rb+++ b/app/models/query/results.rb@@ -49,20 +49,14 @@ class ::Query::Resultsdef sorted_work_packages_matching_the_filters_todaywork_package_scope.where(query.statement)- .includes(all_includes)- .joins(all_joins).order(order_option)- .references(:projects).order(sort_criteria_array)enddef sorted_work_packages_matching_the_filters_at_any_of_the_given_timestampswork_package_scope.where(id: work_packages_matching_the_filters_at_any_of_the_given_timestamps)- .includes(all_includes)- .joins(sort_criteria_joins).order(order_option)- .references(:projects).order(sort_criteria_array)end@@ -96,17 +90,16 @@ class ::Query::Results# https://community.openproject.org/projects/openproject/work_packages/26448#def work_packages_relation- work_package_scope- .where(query.statement)- .includes(all_includes)- .joins(all_joins)- .references(:projects)+ work_package_scope.where(query.statement)enddef work_package_scopeWorkPackage.visible.merge(filter_merges)+ .includes(all_includes)+ .joins(all_joins)+ .references(:projects)enddef all_includes