Commit b46f23fc by Rocky Duan

return at_position_list for content json

parent 782983a0
...@@ -44,7 +44,7 @@ class Comment < Content ...@@ -44,7 +44,7 @@ class Comment < Content
if params[:recursive] if params[:recursive]
self.class.hash_tree(subtree(sort: sort_by_parent_and_time)).first self.class.hash_tree(subtree(sort: sort_by_parent_and_time)).first
else else
as_document.slice(*%w[body course_id endorsed anonymous created_at updated_at]) as_document.slice(*%w[body course_id endorsed anonymous created_at updated_at at_position_list])
.merge("id" => _id) .merge("id" => _id)
.merge("user_id" => author.id) .merge("user_id" => author.id)
.merge("depth" => depth) .merge("depth" => depth)
......
...@@ -77,7 +77,7 @@ class CommentThread < Content ...@@ -77,7 +77,7 @@ class CommentThread < Content
end end
def to_hash(params={}) def to_hash(params={})
doc = as_document.slice(*%w[title body course_id anonymous commentable_id created_at updated_at]) doc = as_document.slice(*%w[title body course_id anonymous commentable_id created_at updated_at at_position_list])
.merge("id" => _id) .merge("id" => _id)
.merge("user_id" => author.id) .merge("user_id" => author.id)
.merge("votes" => votes.slice(*%w[count up_count down_count point])) .merge("votes" => votes.slice(*%w[count up_count down_count point]))
......
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