Add likes model, controller and tests

This commit is contained in:
riggraz
2019-09-27 12:32:30 +02:00
parent e1d8dbc281
commit 970cd6934c
13 changed files with 118 additions and 2 deletions

View File

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