14 lines
323 B
Ruby
14 lines
323 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Users
|
|
class BannedUser < ApplicationRecord
|
|
self.primary_key = :user_id
|
|
|
|
belongs_to :user
|
|
|
|
validates :user, presence: true
|
|
validates :user_id, uniqueness: { message: N_("banned user already exists") }
|
|
end
|
|
end
|
|
|
|
Users::BannedUser.prepend_mod_with('Users::BannedUser')
|