class CompanyCategoryGroup < ApplicationRecord
  include Base::CompanyCategoryGroup

  default_scope { where(type: 2) }

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

  has_many :categories, class_name: 'CompanyCategory', foreign_key: :CCGID, inverse_of: :group,
    dependent: :destroy

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