Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
b46f23fc
Commit
b46f23fc
authored
Aug 04, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return at_position_list for content json
parent
782983a0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
models/comment.rb
+1
-1
models/comment_thread.rb
+1
-1
No files found.
models/comment.rb
View file @
b46f23fc
...
@@ -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
)
...
...
models/comment_thread.rb
View file @
b46f23fc
...
@@ -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]
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment