summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2018-02-20 16:52:24 +0100
committerAndreas Brandl <abrandl@gitlab.com>2018-02-20 16:52:24 +0100
commit715183da4b44603232733be7ae4f7578d0eb6bde (patch)
tree5c6b3f9769b15a5dd94e9e11d7fc936a612ef7fa /app/models
parent80dff37c66c43ab0f477d5998b59b06b7649db70 (diff)
downloadgitlab-ce-715183da4b44603232733be7ae4f7578d0eb6bde.tar.gz
Avoid manual SQL for visibility level check.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index c462ccfe81c..c23501de823 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -342,7 +342,7 @@ class Project < ActiveRecord::Base
authorized_projects = block.call(where('EXISTS (?)', authorized))
levels = Gitlab::VisibilityLevel.levels_for_user(user)
- visible_projects = block.call(where('visibility_level IN (?)', levels))
+ visible_projects = block.call(where(visibility_level: levels))
# We use a UNION here instead of OR clauses since this results in better
# performance.