Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
AO3-177 Spam comments should not be included in comment counts. #2893
Conversation
tickinginstant
added some commits
May 2, 2017
| @@ -27,7 +27,12 @@ def count_all_comments | ||
| # hidden-by-admin comments. | ||
| # returns number of visible (not deleted) comments | ||
| def count_visible_comments | ||
| - self.total_comments.count(:all, conditions: {hidden_by_admin: false, is_deleted: false, unreviewed: false}) | ||
| + self.total_comments.where( |
| @@ -69,7 +69,7 @@ def update_stat_counter | ||
| counter = self.stat_counter || self.create_stat_counter | ||
| counter.update_attributes( | ||
| kudos_count: self.kudos.count, | ||
| - comments_count: self.total_comments.not_deleted.count, | ||
| + comments_count: self.count_visible_comments, |
sarken
added
the
Awaiting review
label
May 2, 2017
sarken
added
Reviewed: Ready to Merge
and removed
Awaiting review
labels
May 3, 2017
| @@ -27,8 +27,13 @@ def count_all_comments | ||
| # hidden-by-admin comments. | ||
| # returns number of visible (not deleted) comments | ||
| def count_visible_comments | ||
| - self.total_comments.where(hidden_by_admin: false, is_deleted: false, unreviewed: false).count | ||
| - end | ||
| + self.total_comments.where( |
sarken
merged commit c0cc4bb
into
otwcode:master
Oct 5, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tickinginstant commentedMay 2, 2017
Issue
https://otwarchive.atlassian.net/browse/AO3-177
Purpose
This pull request updates the comment count code so that spam comments are no longer included in the count. It also modifies the Statistics page so that spam comment threads are no longer included in the thread count.
Testing
I posted a comment on the bug report with some detailed testing steps.
Credit
tickinginstant, she/her