class StudentCategoryGroup < ApplicationRecord
  include Base::StudentCategoryGroup

  associations_for legacy: true do |a|
    a.belongs_to :school
  end

  has_many :categories, class_name: 'StudentCategory', foreign_key: :SCGID, inverse_of: :group,
    dependent: :destroy
  has_many :category_students, through: :categories

  validates :name, presence: true, length: { maximum: 16 }
  validates :description, length: { maximum: 64 }
end
