school.rb 304 B

1234567891011
  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 :courses
  7. has_many :users
  8. end