Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/banzai/reference_parser/issue_parser.rb')
-rw-r--r--lib/banzai/reference_parser/issue_parser.rb31
1 files changed, 21 insertions, 10 deletions
diff --git a/lib/banzai/reference_parser/issue_parser.rb b/lib/banzai/reference_parser/issue_parser.rb
index 6b1491cc56b..d0e74044bba 100644
--- a/lib/banzai/reference_parser/issue_parser.rb
+++ b/lib/banzai/reference_parser/issue_parser.rb
@@ -59,19 +59,30 @@ module Banzai
def records_for_nodes(nodes)
@issues_for_nodes ||= grouped_objects_for_nodes(
nodes,
- Issue.all.includes(
- :author,
- :assignees,
- {
- # These associations are primarily used for checking permissions.
- # Eager loading these ensures we don't end up running dozens of
- # queries in this process.
- project: [:namespace, :project_feature, :route]
- }
- ),
+ Issue.all.includes(node_includes),
self.class.data_attribute
)
end
+
+ private
+
+ def node_includes
+ includes = [
+ :work_item_type,
+ :namespace,
+ :author,
+ :assignees,
+ {
+ # These associations are primarily used for checking permissions.
+ # Eager loading these ensures we don't end up running dozens of
+ # queries in this process.
+ project: [:namespace, :project_feature, :route]
+ }
+ ]
+ includes << :milestone if context.options[:extended_preload]
+
+ includes
+ end
end
end
end