Commit c1b989c8 by Kevin Chugh

consuming groups

parent a706a916
...@@ -16,10 +16,15 @@ get "#{APIPREFIX}/:commentable_id/threads" do |commentable_id| ...@@ -16,10 +16,15 @@ get "#{APIPREFIX}/:commentable_id/threads" do |commentable_id|
end end
post "#{APIPREFIX}/:commentable_id/threads" do |commentable_id| post "#{APIPREFIX}/:commentable_id/threads" do |commentable_id|
thread = CommentThread.new(params.slice(*%w[title body course_id group_id]).merge(commentable_id: commentable_id)) thread = CommentThread.new(params.slice(*%w[title body course_id ]).merge(commentable_id: commentable_id))
thread.anonymous = bool_anonymous || false thread.anonymous = bool_anonymous || false
thread.anonymous_to_peers = bool_anonymous_to_peers || false thread.anonymous_to_peers = bool_anonymous_to_peers || false
thread.tags = params["tags"] || "" thread.tags = params["tags"] || ""
if params["group_id"]
thread.group_id = params["group_id"]
end
thread.author = user thread.author = user
thread.save thread.save
if thread.errors.any? if thread.errors.any?
......
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