Retrospring/app/models/user_ban.rb

7 lines
193 B
Ruby
Raw Normal View History

class UserBan < ApplicationRecord
belongs_to :user
2022-01-11 17:24:38 -08:00
belongs_to :banned_by, class_name: 'User', optional: true
2021-08-14 09:04:58 -07:00
scope :current, -> { where('expires_at IS NULL or expires_at > NOW()') }
end