Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user_custom_attribute.rb')
-rw-r--r--app/models/user_custom_attribute.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/user_custom_attribute.rb b/app/models/user_custom_attribute.rb
index 9a186cb9038..63a5ee9770f 100644
--- a/app/models/user_custom_attribute.rb
+++ b/app/models/user_custom_attribute.rb
@@ -35,6 +35,14 @@ class UserCustomAttribute < ApplicationRecord
.select(:value)
end
+ def set_banned_by_abuse_report(abuse_report)
+ return unless abuse_report
+
+ custom_attribute = { user_id: abuse_report.user.id, key: AUTO_BANNED_BY_ABUSE_REPORT_ID, value: abuse_report.id }
+
+ upsert_custom_attributes([custom_attribute])
+ end
+
private
def blocked_users