summaryrefslogtreecommitdiff
path: root/app/finders/snippets_finder.rb
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2018-02-21 14:56:32 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-02-21 14:56:32 +0000
commit151a43c82e12e019cef62d1c54d9ebf944505325 (patch)
tree67e6d160e2f5686816e07685a82cc71223d0e45a /app/finders/snippets_finder.rb
parentf95bdc67845f8990aaa2c8a605b5ced459c5f5b4 (diff)
parent48b1455566a51f4dea6b3b86553d2f239266a1f9 (diff)
downloadgitlab-ce-rest-of-dispatcher.tar.gz
Merge branch 'master' into 'rest-of-dispatcher'rest-of-dispatcher
# Conflicts: # app/assets/javascripts/dispatcher.js
Diffstat (limited to 'app/finders/snippets_finder.rb')
-rw-r--r--app/finders/snippets_finder.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/finders/snippets_finder.rb b/app/finders/snippets_finder.rb
index 33359fa1efb..ec61fe1892e 100644
--- a/app/finders/snippets_finder.rb
+++ b/app/finders/snippets_finder.rb
@@ -56,8 +56,10 @@ class SnippetsFinder < UnionFinder
end
def feature_available_projects
- projects = Project.public_or_visible_to_user(current_user)
- .with_feature_available_for_user(:snippets, current_user).select(:id)
+ projects = Project.public_or_visible_to_user(current_user, use_where_in: false) do |part|
+ part.with_feature_available_for_user(:snippets, current_user)
+ end.select(:id)
+
arel_query = Arel::Nodes::SqlLiteral.new(projects.to_sql)
table[:project_id].in(arel_query)
end