retrospring/app/models/user_ban.rb
2022-01-02 19:50:01 +01:00

6 lines
177 B
Ruby

class UserBan < ApplicationRecord
belongs_to :user
belongs_to :banned_by, class_name: 'User'
scope :current, -> { where('expires_at IS NULL or expires_at > NOW()') }
end