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
21878b57
Commit
21878b57
authored
Jul 25, 2012
by
Rocky Duan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unnecessary configs
parent
07febd58
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
6 deletions
+2
-6
config/application.yml
+0
-2
models/comment.rb
+1
-2
models/comment_thread.rb
+1
-2
No files found.
config/application.yml
View file @
21878b57
level_limit
:
3
level_limit
:
3
send_notifications_to_author
:
false
allow_anonymity
:
false
models/comment.rb
View file @
21878b57
...
@@ -18,7 +18,6 @@ class Comment < Content
...
@@ -18,7 +18,6 @@ class Comment < Content
validates_presence_of
:body
validates_presence_of
:body
validates_presence_of
:course_id
# do we really need this?
validates_presence_of
:course_id
# do we really need this?
validates_presence_of
:author
if
not
CommentService
.
config
[
"allow_anonymity"
]
validates_presence_of
:comment_thread
validates_presence_of
:comment_thread
before_destroy
:delete_descendants
# TODO async
before_destroy
:delete_descendants
# TODO async
...
@@ -63,7 +62,7 @@ private
...
@@ -63,7 +62,7 @@ private
notification
.
actor
=
author
notification
.
actor
=
author
notification
.
target
=
self
notification
.
target
=
self
notification
.
receivers
<<
(
comment_thread
.
subscribers
+
author
.
followers
).
uniq_by
(
&
:id
)
notification
.
receivers
<<
(
comment_thread
.
subscribers
+
author
.
followers
).
uniq_by
(
&
:id
)
notification
.
receivers
.
delete
(
author
)
if
not
CommentService
.
config
[
"send_notifications_to_author"
]
notification
.
receivers
.
delete
(
author
)
notification
.
save!
notification
.
save!
end
end
end
end
...
...
models/comment_thread.rb
View file @
21878b57
...
@@ -30,7 +30,6 @@ class CommentThread < Content
...
@@ -30,7 +30,6 @@ class CommentThread < Content
validates_presence_of
:body
validates_presence_of
:body
validates_presence_of
:course_id
# do we really need this?
validates_presence_of
:course_id
# do we really need this?
validates_presence_of
:commentable_id
validates_presence_of
:commentable_id
validates_presence_of
:author
if
not
CommentService
.
config
[
"allow_anonymity"
]
after_create
:generate_notifications
after_create
:generate_notifications
...
@@ -85,7 +84,7 @@ private
...
@@ -85,7 +84,7 @@ private
notification
.
actor
=
author
notification
.
actor
=
author
notification
.
target
=
self
notification
.
target
=
self
notification
.
receivers
<<
(
commentable
.
subscribers
+
author
.
followers
).
uniq_by
(
&
:id
)
notification
.
receivers
<<
(
commentable
.
subscribers
+
author
.
followers
).
uniq_by
(
&
:id
)
notification
.
receivers
.
delete
(
author
)
if
not
CommentService
.
config
[
"send_notifications_to_author"
]
and
author
notification
.
receivers
.
delete
(
author
)
notification
.
save!
notification
.
save!
end
end
end
end
...
...
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