Skip to content
Snippets Groups Projects
Commit f7c30ae3 authored by Andreas Brandl's avatar Andreas Brandl
Browse files

Fix N+1 query problem for snippets dashboard.

Closes #40755.
parent b9d547b1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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))
end
 
def authorized_to_user(items)
Loading
Loading
- link_project = local_assigns.fetch(:link_project, false)
 
%li.snippet-row
= image_tag avatar_icon(snippet.author_email), class: "avatar s40 hidden-xs", alt: ''
= image_tag avatar_icon(snippet.author), class: "avatar s40 hidden-xs", alt: ''
 
.title
= link_to reliable_snippet_path(snippet) do
Loading
Loading
---
title: Fix N+1 query problem for snippets dashboard.
merge_request: 16944
author:
type: performance
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment