Merge pull request #2343 from knutaldrin/patch-1

Fix suspended scope
This commit is contained in:
Sam 2014-05-23 12:56:32 +10:00
commit ff6755f1e5
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ class User < ActiveRecord::Base
scope :blocked, -> { where(blocked: true) } # no index scope :blocked, -> { where(blocked: true) } # no index
scope :not_blocked, -> { where(blocked: false) } # 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 :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 # excluding fake users like the community user
scope :real, -> { where('id > 0') } scope :real, -> { where('id > 0') }