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