# frozen_string_literal: true

module Railspress
  class Post < ApplicationRecord
    belongs_to :user, proc { readonly(true) }, class_name: Railspress.user_class.to_s, foreign_key: :user_id, optional: true
    has_many :comments

    validates :title, presence: true
  end
end
