diff options
author | Reuben Pereira <reuben453@gmail.com> | 2018-07-03 10:18:49 +0530 |
---|---|---|
committer | Reuben Pereira <reuben453@gmail.com> | 2018-07-03 10:18:49 +0530 |
commit | 972f12218e6954e183d9654775c4cbedcc97d2eb (patch) | |
tree | 5321db9ef3e4c870412001a8d8accd12e98ec9e8 /lib/banzai | |
parent | c8302b2f50efad5c159fb9e01598259c80887dac (diff) | |
download | gitlab-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.rb | 3 |
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 |