class Pathwright::Category < ApplicationRecord
  include Cacheable

  has_many :courses, dependent: :destroy

  validates :name, presence: true, length: { maximum: 255 }

  private
    def set_cache_keys
      self.cache_keys = ['pathwright/categories', "pathwright/categories/#{id}"]
    end
end
