Commit ff1b1765 by Rocky Duan

dumb method for testing

parent 47c0c700
...@@ -40,6 +40,18 @@ class CommentThread < Content ...@@ -40,6 +40,18 @@ class CommentThread < Content
after_create :generate_notifications after_create :generate_notifications
def self.new_dumb_thread(options={})
c = self.new
c.title = options[:title] || "title"
c.body = options[:body] || "body"
c.commentable_id = options[:commentable_id] || "commentable_id"
c.course_id = options[:course_id] || "course_id"
c.author = options[:author] || User.first
c.tags = options[:tags] || "test-tag-1, test-tag-2"
c.save!
c
end
def root_comments def root_comments
Comment.roots.where(comment_thread_id: self.id) Comment.roots.where(comment_thread_id: self.id)
end end
......
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