2021-08-14 07:07:12 -07:00
|
|
|
class UserBan < ApplicationRecord
|
|
|
|
belongs_to :user
|
|
|
|
belongs_to :banned_by, class_name: 'User'
|
2021-08-14 09:04:58 -07:00
|
|
|
|
|
|
|
scope :current, -> { where('expires_at IS NULL or expires_at < NOW()') }
|
2021-08-14 07:07:12 -07:00
|
|
|
end
|