diff options
author | Reverite <github@reverite.sh> | 2019-05-15 11:12:17 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-05-15 11:12:17 -0700 |
commit | 4cea89bf2e9ce7f73fccfc637191b1e039ad25ee (patch) | |
tree | cc559ad868e13d934ff539bd2da836ddad3ea5fc /app/models/user.rb | |
parent | cdb159f27e2aeb2cf3bb184ac20b7056b013f714 (diff) | |
parent | c1cf8c1636e0a639cced585f0cb234547a64d417 (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 77e6a33b5..8985ebf53 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -88,7 +88,7 @@ class User < ApplicationRecord scope :confirmed, -> { where.not(confirmed_at: nil) } scope :enabled, -> { where(disabled: false) } scope :inactive, -> { where(arel_table[:current_sign_in_at].lt(ACTIVE_DURATION.ago)) } - scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where(accounts: { suspended: false }) } + scope :active, -> { confirmed.where(arel_table[:current_sign_in_at].gteq(ACTIVE_DURATION.ago)).joins(:account).where.not(accounts: { suspended_at: nil }) } scope :matches_email, ->(value) { where(arel_table[:email].matches("#{value}%")) } scope :emailable, -> { confirmed.enabled.joins(:account).merge(Account.searchable) } |