summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorReuben Pereira <reuben453@gmail.com>2018-07-03 10:18:49 +0530
committerReuben Pereira <reuben453@gmail.com>2018-07-03 10:18:49 +0530
commit972f12218e6954e183d9654775c4cbedcc97d2eb (patch)
tree5321db9ef3e4c870412001a8d8accd12e98ec9e8 /lib/banzai
parentc8302b2f50efad5c159fb9e01598259c80887dac (diff)
downloadgitlab-ce-972f12218e6954e183d9654775c4cbedcc97d2eb.tar.gz
Eager load the namespace and route of a project in project_reference_filter.rb
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/project_reference_filter.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/banzai/filter/project_reference_filter.rb b/lib/banzai/filter/project_reference_filter.rb
index 6f257a2d70d..6eead2ab1c3 100644
--- a/lib/banzai/filter/project_reference_filter.rb
+++ b/lib/banzai/filter/project_reference_filter.rb
@@ -70,7 +70,8 @@ module Banzai
# The keys of this Hash are the project paths, the values the
# corresponding Project objects.
def projects_hash
- @projects ||= Project.where_full_path_in(projects)
+ @projects ||= Project.eager_load(:namespace, :route)
+ .where_full_path_in(projects)
.index_by(&:full_path)
.transform_keys(&:downcase)
end