Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2018-02-19 22:16:45 +0300
committerAndreas Brandl <abrandl@gitlab.com>2018-02-20 15:08:25 +0300
commitc8cafb22bd8681e9f1a875e9ff7c7e8e8d30e1b9 (patch)
tree7123c31d6f95f5d6be4b7f84f18e2eaa39e97b6c /app/finders/snippets_finder.rb
parent78d84c13c0cf8a9ed3f92239ef8ba8e9a05609a2 (diff)
Allow choice between #where or #from.
Immediately using #from here requires a lot of changes in other finders (e.g. IssuableFinder, TodosFinder). In all places where we use #merge, this goes completely the wrong way when passed in a relation that was built with `#from(...)`: The original query's FROM part gets completely replaced. This avoids changing all other places and focuses on improving SnippetFinder with the downside of two (small) codepaths to do the same thing.
Diffstat (limited to 'app/finders/snippets_finder.rb')
-rw-r--r--app/finders/snippets_finder.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/finders/snippets_finder.rb b/app/finders/snippets_finder.rb
index c4a84d88dbd..581cd5f47a7 100644
--- a/app/finders/snippets_finder.rb
+++ b/app/finders/snippets_finder.rb
@@ -56,7 +56,7 @@ class SnippetsFinder < UnionFinder
end
def feature_available_projects
- projects = Project.public_or_visible_to_user(current_user) do |part|
+ projects = Project.public_or_visible_to_user(current_user, use_conditions_only: false) do |part|
part.with_feature_available_for_user(:snippets, current_user)
end.select(:id)