diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-05 18:09:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-05 18:09:29 +0300 |
commit | 3e6c042eb05e09d88c2bd988cb9ef5f9eba67794 (patch) | |
tree | 81d43b53312b06796dac6e00ef45b22255958dea /app/models/user.rb | |
parent | c8d44b1e3bd9dd04e5a3724fafd702932d1752be (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index e17803af135..b76d19240f8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -271,6 +271,7 @@ class User < MainClusterwide::ApplicationRecord has_many :bulk_imports has_many :custom_attributes, class_name: 'UserCustomAttribute' + has_one :trusted_with_spam_attribute, -> { UserCustomAttribute.trusted_with_spam }, class_name: 'UserCustomAttribute' has_many :callouts, class_name: 'Users::Callout' has_many :group_callouts, class_name: 'Users::GroupCallout' has_many :project_callouts, class_name: 'Users::ProjectCallout' @@ -2223,8 +2224,8 @@ class User < MainClusterwide::ApplicationRecord } end - def allow_possible_spam? - custom_attributes.by_key(UserCustomAttribute::ALLOW_POSSIBLE_SPAM).exists? + def trusted? + trusted_with_spam_attribute.present? end def namespace_commit_email_for_namespace(namespace) |