Add posts and comments to admin panel

This commit is contained in:
riggraz
2019-09-24 21:16:51 +02:00
parent 7d50454d14
commit e06d95a7bb
17 changed files with 329 additions and 40 deletions

View File

@@ -2,7 +2,7 @@ class Post < ApplicationRecord
belongs_to :board
belongs_to :user
belongs_to :post_status, optional: true
has_many :comments
has_many :comments, dependent: :destroy
validates :title, presence: true, length: { in: 4..64 }