Commit f7c30ae3 authored by Andreas Brandl's avatar Andreas Brandl

Fix N+1 query problem for snippets dashboard.

Closes #40755.
parent b9d547b1
Pipeline #17181094 passed with stages
in 85 minutes and 36 seconds
......@@ -28,7 +28,7 @@ class SnippetsFinder < UnionFinder
segments << items.public_to_user(current_user)
segments << authorized_to_user(items) if current_user
find_union(segments, Snippet)
find_union(segments, Snippet.includes(:author))
def authorized_to_user(items)
- link_project = local_assigns.fetch(:link_project, false)
= image_tag avatar_icon(snippet.author_email), class: "avatar s40 hidden-xs", alt: ''
= image_tag avatar_icon(, class: "avatar s40 hidden-xs", alt: ''
= link_to reliable_snippet_path(snippet) do
title: Fix N+1 query problem for snippets dashboard.
merge_request: 16944
type: performance
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