Add comments'

This commit is contained in:
Ryan W
2021-12-16 14:33:08 -08:00
parent 4edabe6ab1
commit 3a146f7f60
15 changed files with 97 additions and 5 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
class Article < ApplicationRecord
has_rich_text :text
has_many :comments, dependent: :destroy
has_rich_text :content
validates_presence_of :title
end
+4
View File
@@ -0,0 +1,4 @@
class Comment < ApplicationRecord
belongs_to :article
broadcasts_to :article
end