Commit 0bf762e5 by Rocky Duan

allow comments with only title or body

parent c2b41750
......@@ -12,7 +12,8 @@ class Comment < ActiveRecord::Base
acts_as_voteable
validates_presence_of :body, :unless => :is_root?
validates_presence_of :title, :unless => Proc.new{|c| c.is_root? or c.body}
validates_presence_of :body, :unless => Proc.new{|c| c.is_root? or c.title}
validates_presence_of :user_id, :unless => :is_root?
validates_presence_of :course_id, :unless => :is_root?
validates_presence_of :comment_thread_id
......
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