Commit 90a56da0 by Rocky Duan

add validation for commentable_id

parent fa7cf193
...@@ -19,6 +19,7 @@ class CommentThread < Content ...@@ -19,6 +19,7 @@ class CommentThread < Content
validates_presence_of :title validates_presence_of :title
validates_presence_of :body validates_presence_of :body
validates_presence_of :course_id # do we really need this? validates_presence_of :course_id # do we really need this?
validates_presence_of :commentable_id
validates_presence_of :author if not CommentService.config["allow_anonymity"] validates_presence_of :author if not CommentService.config["allow_anonymity"]
after_create :handle_after_create after_create :handle_after_create
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment