about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-09-11 16:32:44 +0200
committerGitHub <noreply@github.com>2019-09-11 16:32:44 +0200
commitc5d37f18cb3f4d6212fb8f3e1c4e1e027f677ec5 (patch)
tree190b0c85e6e8f3880d9d291781d9a73185e0252c /app/models/status.rb
parent4fe127664b0ae22a528b4a4467ab2de92e3da3ef (diff)
Change deletes to preserve soft-deleted statuses in unresolved reports (#11805)
Change all account actions except "none" to resolve all unresolved reports

Refactor `SuspendAccountService` to be more readable
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 9cfaddcec..471bb03b4 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -214,6 +214,10 @@ class Status < ApplicationRecord
     !sensitive? && with_media?
   end
 
+  def reported?
+    @reported ||= Report.where(target_account: account).unresolved.where('? = ANY(status_ids)', id).exists?
+  end
+
   def emojis
     return @emojis if defined?(@emojis)