Add coverage for ReportFilter and AccountFilter (#3236)
This commit is contained in:
parent
b51398d0dd
commit
e1b42e9aa0
5 changed files with 51 additions and 12 deletions
|
@ -89,6 +89,8 @@ class Account < ApplicationRecord
|
|||
scope :recent, -> { reorder(id: :desc) }
|
||||
scope :alphabetic, -> { order(domain: :asc, username: :asc) }
|
||||
scope :by_domain_accounts, -> { group(:domain).select(:domain, 'COUNT(*) AS accounts_count').order('accounts_count desc') }
|
||||
scope :matches_username, ->(value) { where(arel_table[:username].matches("#{value}%")) }
|
||||
scope :matches_display_name, ->(value) { where(arel_table[:display_name].matches("#{value}%")) }
|
||||
|
||||
delegate :email,
|
||||
:current_sign_in_ip,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue