about summary refs log tree commit diff
path: root/app/models/domain_block.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/domain_block.rb')
-rw-r--r--app/models/domain_block.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb
index 0b12617c6..84c08c158 100644
--- a/app/models/domain_block.rb
+++ b/app/models/domain_block.rb
@@ -17,8 +17,6 @@ class DomainBlock < ApplicationRecord
 
   enum severity: [:silence, :suspend, :noop]
 
-  attr_accessor :retroactive
-
   validates :domain, presence: true, uniqueness: true
 
   has_many :accounts, foreign_key: :domain, primary_key: :domain
@@ -36,4 +34,9 @@ class DomainBlock < ApplicationRecord
     return false if other_block.silence? && noop?
     (reject_media || !other_block.reject_media) && (reject_reports || !other_block.reject_reports)
   end
+
+  def affected_accounts_count
+    scope = suspend? ? accounts.where(suspended_at: created_at) : accounts.where(silenced_at: created_at)
+    scope.count
+  end
 end