summaryrefslogtreecommitdiff
path: root/app/models/users/banned_user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/users/banned_user.rb')
-rw-r--r--app/models/users/banned_user.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/users/banned_user.rb b/app/models/users/banned_user.rb
new file mode 100644
index 00000000000..c52b6d4b728
--- /dev/null
+++ b/app/models/users/banned_user.rb
@@ -0,0 +1,12 @@
+# 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: _("banned user already exists") }
+ end
+end