mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Fix suspended scope
:non_suspended should check if suspension is <= NOW, else one could end up in neither group.
This commit is contained in:
parent
986e8f2f0f
commit
579f2bf7b8
1 changed files with 1 additions and 1 deletions
|
@ -88,7 +88,7 @@ class User < ActiveRecord::Base
|
|||
scope :blocked, -> { where(blocked: true) } # no index
|
||||
scope :not_blocked, -> { where(blocked: false) } # no index
|
||||
scope :suspended, -> { where('suspended_till IS NOT NULL AND suspended_till > ?', Time.zone.now) } # no index
|
||||
scope :not_suspended, -> { where('suspended_till IS NULL') }
|
||||
scope :not_suspended, -> { where('suspended_till IS NULL OR suspended_till <= ?', Time.zone.now) }
|
||||
# excluding fake users like the community user
|
||||
scope :real, -> { where('id > 0') }
|
||||
|
||||
|
|
Loading…
Reference in a new issue