debian-mirror-gitlab/app/models/users/banned_user.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
484 B
Ruby
Raw Normal View History

2021-10-27 15:23:28 +05:30
# frozen_string_literal: true
module Users
class BannedUser < ApplicationRecord
self.primary_key = :user_id
belongs_to :user
2023-07-09 08:55:56 +05:30
has_one :credit_card_validation, class_name: '::Users::CreditCardValidation', primary_key: 'user_id',
foreign_key: 'user_id', inverse_of: :banned_user
2021-10-27 15:23:28 +05:30
validates :user, presence: true
2022-11-25 23:54:43 +05:30
validates :user_id, uniqueness: { message: N_("banned user already exists") }
2021-10-27 15:23:28 +05:30
end
end
2023-05-27 22:25:52 +05:30
Users::BannedUser.prepend_mod_with('Users::BannedUser')