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
17870591
Commit
17870591
authored
Sep 12, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor stylistic change to CommentThread.to_hash.
parent
2af135dd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
models/comment_thread.rb
+6
-7
No files found.
models/comment_thread.rb
View file @
17870591
...
...
@@ -153,13 +153,12 @@ class CommentThread < Content
def
to_hash
(
params
=
{})
doc
=
as_document
.
slice
(
*
%w[title body course_id anonymous commentable_id created_at updated_at at_position_list closed]
)
.
merge
(
"id"
=>
_id
)
.
merge
(
"user_id"
=>
author
.
id
)
.
merge
(
"username"
=>
author
.
username
)
.
merge
(
"votes"
=>
votes
.
slice
(
*
%w[count up_count down_count point]
))
.
merge
(
"tags"
=>
tags_array
)
.
merge
(
"type"
=>
"thread"
)
.
merge
(
"endorsed"
=>
endorsed?
)
.
merge
(
"id"
=>
_id
,
"user_id"
=>
author
.
id
,
"username"
=>
author
.
username
,
"votes"
=>
votes
.
slice
(
*
%w[count up_count down_count point]
),
"tags"
=>
tags_array
,
"type"
=>
"thread"
,
"endorsed"
=>
endorsed?
)
if
params
[
:recursive
]
doc
=
doc
.
merge
(
"children"
=>
root_comments
.
map
{
|
c
|
c
.
to_hash
(
recursive:
true
)})
...
...
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