class Category < ApplicationRecord
  has_many :document_categories
  has_many :documents, through: :document_categories
  
  validates :title, {
    presence: true,
    length: { minimum: 3, maximum: 30 },
    uniqueness: true
  }
  
end
