mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-13 21:33:20 +01:00
10 lines
237 B
Ruby
10 lines
237 B
Ruby
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
|
|
end
|