diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2018-02-06 15:20:42 +0300 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2018-02-07 02:22:13 +0300 |
commit | f7c30ae30d878de3980f65a2c3353503a440a615 (patch) | |
tree | 0b6b6b1fd7393aa3d7cb940796c783a9f6613100 /app/finders | |
parent | b9d547b12c3731160c456f3f20366e600ab99484 (diff) |
Fix N+1 query problem for snippets dashboard.
Closes #40755.
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/snippets_finder.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/finders/snippets_finder.rb b/app/finders/snippets_finder.rb index c04f61de79c..4450766485f 100644 --- a/app/finders/snippets_finder.rb +++ b/app/finders/snippets_finder.rb @@ -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) |