class Topic < ApplicationRecord
  self.table_name = 'threads'

  has_many :posts, foreign_key: :thread_id, dependent: :destroy

  scope :active, -> { where deleted_at: nil }

  validates :name, presence: true
end
