From 715183da4b44603232733be7ae4f7578d0eb6bde Mon Sep 17 00:00:00 2001 From: Andreas Brandl Date: Tue, 20 Feb 2018 16:52:24 +0100 Subject: Avoid manual SQL for visibility level check. --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models') 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. -- cgit v1.2.1