diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-15 09:07:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-15 09:07:50 +0300 |
commit | 3c5195204b69df0bc69a0c98c7d61d258dc39866 (patch) | |
tree | 10af5c42e5ff538069565954476925709d94b679 /app/models/issue.rb | |
parent | c40b7517717b0d23893a92527819fd05c2531b93 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index f517f42d6ba..b338ecfce88 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -178,6 +178,14 @@ class Issue < ApplicationRecord scope :confidential_only, -> { where(confidential: true) } + scope :without_hidden, -> { + if Feature.enabled?(:ban_user_feature_flag) + where.not(author_id: Users::BannedUser.all.select(:user_id)) + else + all + end + } + scope :counts_by_state, -> { reorder(nil).group(:state_id).count } scope :service_desk, -> { where(author: ::User.support_bot) } @@ -650,6 +658,10 @@ class Issue < ApplicationRecord end end + def hidden? + author&.banned? + end + # Necessary until all issues are backfilled and we add a NOT NULL constraint on the DB def work_item_type super || WorkItems::Type.default_by_type(issue_type) |