|
|
@ -28,7 +28,6 @@ class DomainBlock < ApplicationRecord
|
|
|
|
has_many :accounts, foreign_key: :domain, primary_key: :domain, inverse_of: false, dependent: nil
|
|
|
|
has_many :accounts, foreign_key: :domain, primary_key: :domain, inverse_of: false, dependent: nil
|
|
|
|
delegate :count, to: :accounts, prefix: true
|
|
|
|
delegate :count, to: :accounts, prefix: true
|
|
|
|
|
|
|
|
|
|
|
|
scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) }
|
|
|
|
|
|
|
|
scope :with_user_facing_limitations, -> { where(severity: [:silence, :suspend]) }
|
|
|
|
scope :with_user_facing_limitations, -> { where(severity: [:silence, :suspend]) }
|
|
|
|
scope :with_limitations, -> { where(severity: [:silence, :suspend]).or(where(reject_media: true)) }
|
|
|
|
scope :with_limitations, -> { where(severity: [:silence, :suspend]).or(where(reject_media: true)) }
|
|
|
|
scope :by_severity, -> { in_order_of(:severity, %w(noop silence suspend)).order(:domain) }
|
|
|
|
scope :by_severity, -> { in_order_of(:severity, %w(noop silence suspend)).order(:domain) }
|
|
|
|