class ContactCategoryGroup < ApplicationRecord
  include Base::ContactCategoryGroup

  default_scope { where(type: 1) }

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

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

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