#2 ぼちぼち

This commit is contained in:
2025-02-27 23:38:45 +09:00
parent c6deba7c26
commit 137c86bba7
18 changed files with 156 additions and 31 deletions
+12
View File
@@ -0,0 +1,12 @@
class User < ApplicationRecord
validates :name, length: { maximum: 255 }
validates :inheritance_code, presence: true, length: { maximum: 64 }
validates :role, presence: true, inclusion: { in: roles.keys }
validates :banned, inclusion: { in: [true, false] }
enum role: { guest: 'guest', member: 'member', admin: 'admin' }
has_many :posts
has_many :settings
has_many :ip_addresses
end