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

@ -53,6 +53,8 @@ class User < ApplicationRecord
scope :admins, -> { where(admin: true) }
scope :confirmed, -> { where.not(confirmed_at: nil) }
scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) }
scope :matches_email, ->(value) { where(arel_table[:email].matches("#{value}%")) }
scope :with_recent_ip_address, ->(value) { where(arel_table[:current_sign_in_ip].eq(value).or(arel_table[:last_sign_in_ip].eq(value))) }
before_validation :sanitize_languages