about summary refs log tree commit diff
path: root/app/models/report.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-06-20 02:52:34 +0200
committerGitHub <noreply@github.com>2019-06-20 02:52:34 +0200
commit7696f77245c2302787d239da50248385b3292a5e (patch)
tree81db43f660c382679cc7a834d0be06c0218592a8 /app/models/report.rb
parent33144e132d28f5b820ae12e4b8e4fb34ca47b1d6 (diff)
Add moderation API (#9387)
Fix #8580
Fix #7143
Diffstat (limited to 'app/models/report.rb')
-rw-r--r--app/models/report.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/report.rb b/app/models/report.rb
index 86c303798..5192ceef7 100644
--- a/app/models/report.rb
+++ b/app/models/report.rb
@@ -17,6 +17,8 @@
 #
 
 class Report < ApplicationRecord
+  include Paginable
+
   belongs_to :account
   belongs_to :target_account, class_name: 'Account'
   belongs_to :action_taken_by_account, class_name: 'Account', optional: true
@@ -26,6 +28,7 @@ class Report < ApplicationRecord
 
   scope :unresolved, -> { where(action_taken: false) }
   scope :resolved,   -> { where(action_taken: true) }
+  scope :with_accounts, -> { includes([:account, :target_account, :action_taken_by_account, :assigned_account].each_with_object({}) { |k, h| h[k] = { user: [:invite_request, :invite] } }) }
 
   validates :comment, length: { maximum: 1000 }