summaryrefslogtreecommitdiff
path: root/lib/banzai/reference_parser/issue_parser.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-22 06:09:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-22 06:09:46 +0000
commitb06ba604b8d1b40758ebbda5008fe3294d0f2a2a (patch)
tree4da549dc17b5ab32bb47076299b45fec74866563 /lib/banzai/reference_parser/issue_parser.rb
parent34daf3bdb3c68289eb2eedfb78cd4deb816047fd (diff)
downloadgitlab-ce-b06ba604b8d1b40758ebbda5008fe3294d0f2a2a.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/banzai/reference_parser/issue_parser.rb')
-rw-r--r--lib/banzai/reference_parser/issue_parser.rb23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/banzai/reference_parser/issue_parser.rb b/lib/banzai/reference_parser/issue_parser.rb
index 6b1491cc56b..ecf77191c13 100644
--- a/lib/banzai/reference_parser/issue_parser.rb
+++ b/lib/banzai/reference_parser/issue_parser.rb
@@ -57,18 +57,21 @@ module Banzai
end
def records_for_nodes(nodes)
+ node_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]
+ }
+ ]
+ node_includes << :milestone if context.options[:extended_preload]
+
@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