Add comments'
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class Comment < ApplicationRecord
|
||||
belongs_to :article
|
||||
broadcasts_to :article
|
||||
end
|
||||
Reference in New Issue
Block a user