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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-01-09 15:07:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-09 15:07:31 +0300
commit1935f3e81b99c00697bf0b4d6a44d64068b34745 (patch)
treee2c42218945d0ae19c4566e844d4707513cc2fd6 /app/models/abuse_report.rb
parenta352bc8e72b948a834b0569d0d4288e95a9c529e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/abuse_report.rb')
-rw-r--r--app/models/abuse_report.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/abuse_report.rb b/app/models/abuse_report.rb
index c90023dd9df..424778af4e6 100644
--- a/app/models/abuse_report.rb
+++ b/app/models/abuse_report.rb
@@ -13,7 +13,13 @@ class AbuseReport < ApplicationRecord
validates :user, presence: true
validates :message, presence: true
validates :category, presence: true
- validates :user_id, uniqueness: { message: 'has already been reported' }
+ validates :user_id,
+ uniqueness: {
+ scope: :reporter_id,
+ message: ->(object, data) do
+ _('You have already reported this user')
+ end
+ }
scope :by_user, ->(user) { where(user_id: user) }
scope :with_users, -> { includes(:reporter, :user) }