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>2019-11-11 21:06:27 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-11 21:06:27 +0300
commitff67e3ed08355fb2d6f6e69d4ed06cd09052e573 (patch)
tree97ac29ddd32b612343b34bbdd6b8d57526b3d308 /app/models/abuse_report.rb
parent7071f9bf3e131a7a668922ee450da529f1866b6f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/abuse_report.rb')
-rw-r--r--app/models/abuse_report.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/abuse_report.rb b/app/models/abuse_report.rb
index a3a1748142f..7cfebf0473f 100644
--- a/app/models/abuse_report.rb
+++ b/app/models/abuse_report.rb
@@ -2,6 +2,7 @@
class AbuseReport < ApplicationRecord
include CacheMarkdownField
+ include Sortable
cache_markdown_field :message, pipeline: :single_line
@@ -13,6 +14,9 @@ class AbuseReport < ApplicationRecord
validates :message, presence: true
validates :user_id, uniqueness: { message: 'has already been reported' }
+ scope :by_user, -> (user) { where(user_id: user) }
+ scope :with_users, -> { includes(:reporter, :user) }
+
# For CacheMarkdownField
alias_method :author, :reporter