Growstuff/growstuff

View on GitHub
app/models/forum.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

class Forum < ApplicationRecord
  extend FriendlyId
  include Ownable
  validates :name, presence: true
  validates :description, presence: true
  friendly_id :name, use: %i(slugged finders)

  has_many :posts, dependent: :destroy

  def to_s
    name
  end
end