about summary refs log tree commit diff
path: root/app/models/report.rb
diff options
context:
space:
mode:
authorReverite <github@reverite.sh>2019-06-26 20:31:07 -0700
committerReverite <github@reverite.sh>2019-06-26 20:31:07 -0700
commit3fa90982efda2109ddf90d81f5ed3449f8282642 (patch)
treee5514f4c72c9ffb44059a2afb7fdf24d0348bbd4 /app/models/report.rb
parent714940de498e93a8bf40dcda1835217df18741bf (diff)
parent9ef25877dfda12cf31ec586294e4d4908f5be4f0 (diff)
Merge branch 'glitch' into production
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 }