|
|
@ -117,6 +117,7 @@ class Account < ApplicationRecord |
|
|
|
scope :partitioned, -> { order(Arel.sql('row_number() over (partition by domain)')) } |
|
|
|
scope :partitioned, -> { order(Arel.sql('row_number() over (partition by domain)')) } |
|
|
|
scope :silenced, -> { where(silenced: true) } |
|
|
|
scope :silenced, -> { where(silenced: true) } |
|
|
|
scope :suspended, -> { where(suspended: true) } |
|
|
|
scope :suspended, -> { where(suspended: true) } |
|
|
|
|
|
|
|
scope :without_suspended, -> { where(suspended: false) } |
|
|
|
scope :recent, -> { reorder(id: :desc) } |
|
|
|
scope :recent, -> { reorder(id: :desc) } |
|
|
|
scope :alphabetic, -> { order(domain: :asc, username: :asc) } |
|
|
|
scope :alphabetic, -> { order(domain: :asc, username: :asc) } |
|
|
|
scope :by_domain_accounts, -> { group(:domain).select(:domain, 'COUNT(*) AS accounts_count').order('accounts_count desc') } |
|
|
|
scope :by_domain_accounts, -> { group(:domain).select(:domain, 'COUNT(*) AS accounts_count').order('accounts_count desc') } |
|
|
|