mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-26 16:43:02 +01:00
banana
This commit is contained in:
parent
ea8672c7da
commit
9facb4c831
1 changed files with 0 additions and 14 deletions
|
@ -1,14 +0,0 @@
|
||||||
class UserBan < ApplicationRecord
|
|
||||||
belongs_to :user
|
|
||||||
belongs_to :banned_by, class_name: "User", optional: true
|
|
||||||
|
|
||||||
scope :current, -> { where("expires_at IS NULL or expires_at > NOW()") }
|
|
||||||
|
|
||||||
def permanent?
|
|
||||||
expires_at.nil?
|
|
||||||
end
|
|
||||||
|
|
||||||
def current?
|
|
||||||
permanent? || expires_at > Time.now.utc
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in a new issue