Commit 21878b57 by Rocky Duan

removed unnecessary configs

parent 07febd58
level_limit: 3 level_limit: 3
send_notifications_to_author: false
allow_anonymity: false
...@@ -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
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment