Fixing ban scopes for new syntax

This commit is contained in:
Absurdon 2017-11-25 14:43:32 +01:00 committed by Ari Timonen
parent efcaab5a86
commit 9252200dc0

View file

@ -28,9 +28,9 @@ class Ban < ActiveRecord::Base
attr_accessor :len, :user_name
scope :ordered, order: "created_at DESC"
scope :effective, conditions: "expiry > UTC_TIMESTAMP()"
scope :ineffective, conditions: "expiry < UTC_TIMESTAMP()"
scope :ordered, -> { order(created_at: :desc ) }
scope :effective, -> { where("expiry > UTC_TIMESTAMP()") }
scope :ineffective, -> { where("expiry < UTC_TIMESTAMP()") }
before_validation :check_user