Commit 715183da authored by Andreas Brandl's avatar Andreas Brandl

Avoid manual SQL for visibility level check.

parent 80dff37c
...@@ -342,7 +342,7 @@ class Project < ActiveRecord::Base ...@@ -342,7 +342,7 @@ class Project < ActiveRecord::Base
authorized_projects = block.call(where('EXISTS (?)', authorized)) authorized_projects = block.call(where('EXISTS (?)', authorized))
levels = Gitlab::VisibilityLevel.levels_for_user(user) 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 # We use a UNION here instead of OR clauses since this results in better
# performance. # performance.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment