added validation to comment
This commit is contained in:
parent
8479f308ac
commit
2d44eeef60
|
@ -3,4 +3,6 @@ class Comment < ActiveRecord::Base
|
||||||
belongs_to :answer
|
belongs_to :answer
|
||||||
validates :user_id, presence: true
|
validates :user_id, presence: true
|
||||||
validates :answer_id, presence: true
|
validates :answer_id, presence: true
|
||||||
|
|
||||||
|
validates :content, length: { maximum: 160 }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue