Retrospring/app/models/user_ban.rb

7 lines
193 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()') }
end