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
6f61a891
Commit
6f61a891
authored
Sep 19, 2012
by
Arjun Singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change names to be more consistent
parent
b9a7db7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
models/comment_thread.rb
+5
-5
No files found.
models/comment_thread.rb
View file @
6f61a891
...
...
@@ -185,19 +185,19 @@ class CommentThread < Content
:updated_at
=>
{:
$gte
=>
last_read_time
},
:author_id
=>
{:
$ne
=>
params
[
:user_id
]},
).
count
viewe
d
=
last_read_time
>=
self
.
updated_at
unrea
d
=
last_read_time
>=
self
.
updated_at
else
unread_count
=
self
.
comments
.
where
(
:author_id
=>
{:
$ne
=>
params
[
:user_id
]}).
count
viewe
d
=
false
unrea
d
=
false
end
else
# If there's no user, say it's
not viewe
d and all comments are unread
# If there's no user, say it's
unrea
d and all comments are unread
unread_count
=
comments_count
viewe
d
=
false
unrea
d
=
false
end
doc
=
doc
.
merge
(
"unread_comments_count"
=>
unread_count
)
.
merge
(
"
viewed"
=>
viewe
d
)
.
merge
(
"
unread"
=>
unrea
d
)
.
merge
(
"comments_count"
=>
comments_count
)
doc
...
...
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