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
cc0ef24e
Commit
cc0ef24e
authored
Aug 04, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return username for display
parent
3ce012bb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
0 deletions
+5
-0
models/comment.rb
+1
-0
models/comment_thread.rb
+1
-0
models/observers/at_user_observer.rb
+1
-0
models/observers/post_reply_observer.rb
+1
-0
models/observers/post_topic_observer.rb
+1
-0
No files found.
models/comment.rb
View file @
cc0ef24e
...
...
@@ -47,6 +47,7 @@ class Comment < Content
as_document
.
slice
(
*
%w[body course_id endorsed anonymous created_at updated_at at_position_list]
)
.
merge
(
"id"
=>
_id
)
.
merge
(
"user_id"
=>
author
.
id
)
.
merge
(
"username"
=>
author
.
username
)
.
merge
(
"depth"
=>
depth
)
.
merge
(
"thread_id"
=>
comment_thread
.
id
)
.
merge
(
"votes"
=>
votes
.
slice
(
*
%w[count up_count down_count point]
))
...
...
models/comment_thread.rb
View file @
cc0ef24e
...
...
@@ -80,6 +80,7 @@ class CommentThread < Content
doc
=
as_document
.
slice
(
*
%w[title body course_id anonymous commentable_id created_at updated_at at_position_list]
)
.
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
)
...
...
models/observers/at_user_observer.rb
View file @
cc0ef24e
...
...
@@ -30,6 +30,7 @@ class AtUserObserver < Mongoid::Observer
content_id:
content
.
id
,
content_type:
content_type
,
thread_title:
content_type
==
:thread
?
content
.
title
:
content
.
comment_thread
.
title
,
actor_username:
(
content
.
author
.
username
if
not
content
.
anonymous
),
}
)
notification
.
actor
=
content
.
author
if
not
content
.
anonymous
...
...
models/observers/post_reply_observer.rb
View file @
cc0ef24e
...
...
@@ -14,6 +14,7 @@ class PostReplyObserver < Mongoid::Observer
thread_title:
comment
.
comment_thread
.
title
,
comment_id:
comment
.
id
,
commentable_id:
comment
.
comment_thread
.
commentable_id
,
actor_username:
(
comment
.
author
.
username
if
not
comment
.
anonymous
),
},
)
notification
.
actor
=
comment
.
author
if
not
comment
.
anonymous
...
...
models/observers/post_topic_observer.rb
View file @
cc0ef24e
...
...
@@ -14,6 +14,7 @@ class PostTopicObserver < Mongoid::Observer
#commentable_type: commentable.commentable_type,
thread_id:
comment_thread
.
id
,
thread_title:
comment_thread
.
title
,
actor_username:
(
comment_thread
.
author
.
username
if
not
comment_thread
.
anonymous
),
},
)
notification
.
actor
=
comment_thread
.
author
if
not
comment_thread
.
anonymous
...
...
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