ぼざクリ タグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

13 lines
401 B

  1. class User < ApplicationRecord
  2. validates :name, length: { maximum: 255 }
  3. validates :inheritance_code, presence: true, length: { maximum: 64 }
  4. validates :role, presence: true, inclusion: { in: roles.keys }
  5. validates :banned, inclusion: { in: [true, false] }
  6. enum role: { guest: 'guest', member: 'member', admin: 'admin' }
  7. has_many :posts
  8. has_many :settings
  9. has_many :ip_addresses
  10. end