diff --git a/app/models/comment.rb b/app/models/comment.rb index ef5cd49c..51ce7d91 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -1,4 +1,6 @@ class Comment < ActiveRecord::Base belongs_to :user belongs_to :answer + validates :user_id, presence: true + validates :answer_id, presence: true end