Commit 7429eb3b authored by Reuben Pereira's avatar Reuben Pereira

Eager load a project's route and its namespace with route in project_reference_filter

parent 6572e045
...@@ -70,7 +70,7 @@ module Banzai ...@@ -70,7 +70,7 @@ module Banzai
# The keys of this Hash are the project paths, the values the # The keys of this Hash are the project paths, the values the
# corresponding Project objects. # corresponding Project objects.
def projects_hash def projects_hash
@projects ||= Project.eager_load(:namespace, :route) @projects ||= Project.eager_load(:route, namespace: [:route])
.where_full_path_in(projects) .where_full_path_in(projects)
.index_by(&:full_path) .index_by(&:full_path)
.transform_keys(&:downcase) .transform_keys(&:downcase)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment