summaryrefslogtreecommitdiff
path: root/app/models/users_star_project.rb
diff options
context:
space:
mode:
authorCamil Staps <info@camilstaps.nl>2019-02-02 20:22:19 +0100
committerCamil Staps <info@camilstaps.nl>2019-08-07 20:49:16 +0200
commit50f5f2e8aebf7ea3cdc9b2d133c9246925f749c4 (patch)
tree5e60baacc5e040aa917390bca651c1aacc8b91c6 /app/models/users_star_project.rb
parent66032506b54dc4a9fcce99d2053a65cbaa02d2a2 (diff)
downloadgitlab-ce-50f5f2e8aebf7ea3cdc9b2d133c9246925f749c4.tar.gz
Remove private profiles from starrers view of projects
Diffstat (limited to 'app/models/users_star_project.rb')
-rw-r--r--app/models/users_star_project.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/users_star_project.rb b/app/models/users_star_project.rb
index 62d44aaf955..6eabdebd89c 100644
--- a/app/models/users_star_project.rb
+++ b/app/models/users_star_project.rb
@@ -15,6 +15,7 @@ class UsersStarProject < ApplicationRecord
scope :order_user_name_asc, -> { joins(:user).reorder('"users"."name" ASC') }
scope :order_user_name_desc, -> { joins(:user).reorder('"users"."name" DESC') }
scope :by_project, -> (project) { where(project_id: project.id) }
+ scope :with_visible_profile, -> (user) { joins(:user).where('"users"."private_profile" IS NULL OR "users"."private_profile" = ? OR "users"."id" = ?', false, user.id ) }
class << self
def sort_by_attribute(method)