Add domain search/filter to the "Federation" (/admin/instances) page (#10071)
This commit is contained in:
@ -24,6 +24,8 @@ class DomainBlock < ApplicationRecord
|
||||
has_many :accounts, foreign_key: :domain, primary_key: :domain
|
||||
delegate :count, to: :accounts, prefix: true
|
||||
|
||||
scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) }
|
||||
|
||||
def self.blocked?(domain)
|
||||
where(domain: domain, severity: :suspend).exists?
|
||||
end
|
||||
|
Reference in New Issue
Block a user