#2 ぼちぼち
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user