diff options
author | Camil Staps <info@camilstaps.nl> | 2019-02-02 22:22:19 +0300 |
---|---|---|
committer | Camil Staps <info@camilstaps.nl> | 2019-08-07 21:49:16 +0300 |
commit | 50f5f2e8aebf7ea3cdc9b2d133c9246925f749c4 (patch) | |
tree | 5e60baacc5e040aa917390bca651c1aacc8b91c6 /app/models/users_star_project.rb | |
parent | 66032506b54dc4a9fcce99d2053a65cbaa02d2a2 (diff) |
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.rb | 1 |
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) |