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
f5d3af22
Commit
f5d3af22
authored
Jul 30, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return commentable_id of threads
parent
ff1b1765
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletions
+2
-1
models/comment_thread.rb
+1
-1
spec/api/comment_thread_spec.rb
+1
-0
No files found.
models/comment_thread.rb
View file @
f5d3af22
...
...
@@ -69,7 +69,7 @@ class CommentThread < Content
end
def
to_hash
(
params
=
{})
doc
=
as_document
.
slice
(
*
%w[title body course_id created_at updated_at]
)
doc
=
as_document
.
slice
(
*
%w[title body course_id c
ommentable_id c
reated_at updated_at]
)
.
merge
(
"id"
=>
_id
)
.
merge
(
"user_id"
=>
(
author
.
id
if
author
))
.
merge
(
"votes"
=>
votes
.
slice
(
*
%w[count up_count down_count point]
))
...
...
spec/api/comment_thread_spec.rb
View file @
f5d3af22
...
...
@@ -13,6 +13,7 @@ describe "app" do
thread
.
body
.
should
==
response_thread
[
"body"
]
thread
.
course_id
.
should
==
response_thread
[
"course_id"
]
thread
.
votes_point
.
should
==
response_thread
[
"votes"
][
"point"
]
thread
.
commentable_id
.
should
==
response_thread
[
"commentable_id"
]
response_thread
[
"children"
].
should
be_nil
end
it
"get information of a single comment thread with its comments"
do
...
...
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