blob: 8a62744c7d6ee2a08960425418428a659898fe13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# frozen_string_literal: true
module Users
class BannedUser < ApplicationRecord
self.primary_key = :user_id
belongs_to :user
has_one :credit_card_validation, class_name: '::Users::CreditCardValidation', primary_key: 'user_id',
foreign_key: 'user_id', inverse_of: :banned_user
validates :user, presence: true
validates :user_id, uniqueness: { message: N_("banned user already exists") }
end
end
Users::BannedUser.prepend_mod_with('Users::BannedUser')
|