Add coverage for ReportFilter and AccountFilter (#3236)

This commit is contained in:
Matt Jankowski
2017-05-22 15:50:58 -04:00
committed by GitHub
parent b51398d0dd
commit e1b42e9aa0
5 changed files with 51 additions and 12 deletions

View File

@ -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,