diff options
author | Gabriel Mazetto <brodock@gmail.com> | 2018-11-14 08:07:35 +0300 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2018-12-10 23:34:33 +0300 |
commit | 4f5abe43279e96efde5f8cac66cbff30d8a95f28 (patch) | |
tree | 931664a9662da2de4ce46781d2715f6426afc120 /app/helpers/projects_helper.rb | |
parent | 1297a1bd7dcccaa4e233925c8467c2bbe41a4bf2 (diff) |
Reduce N+1 from Activity Dashboard and Banzai
There is a combination of few strategies implemented here:
1. Few relations were eager loaded
2. Changed few polymorphic routes to specific ones so we don't have to
use `#becomes(Namespace)` which doesn't preserve association cache
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r-- | app/helpers/projects_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 87aebe415c8..7c8557a1a8a 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -2,7 +2,7 @@ module ProjectsHelper def link_to_project(project) - link_to [project.namespace.becomes(Namespace), project], title: h(project.name) do + link_to namespace_project_path(namespace_id: project.namespace, id: project), title: h(project.name) do title = content_tag(:span, project.name, class: 'project-name') if project.namespace |