school.rb 283 B

123456789
  1. class School < ApplicationRecord
  2. validates :name, presence: true, length: { maximum: 255 }
  3. has_many :administrations, dependent: :destroy
  4. has_many :administrators, through: :administrations,
  5. class_name: "User", source: :user
  6. has_many :users
  7. end