Only count reports from distinct users in spam checks
This commit is contained in:
parent
c50e4f50c4
commit
a87cd780d6
1 changed files with 1 additions and 1 deletions
|
@ -359,7 +359,7 @@ class User < ApplicationRecord
|
|||
trace_score = traces.size * 50
|
||||
diary_entry_score = diary_entries.visible.inject(0) { |acc, elem| acc + elem.body.spam_score }
|
||||
diary_comment_score = diary_comments.visible.inject(0) { |acc, elem| acc + elem.body.spam_score }
|
||||
report_score = Report.where(:category => "spam", :issue => issues.with_status("open")).count * 20
|
||||
report_score = Report.where(:category => "spam", :issue => issues.with_status("open")).distinct.count(:user_id) * 20
|
||||
|
||||
score = description.spam_score / 4.0
|
||||
score += diary_entries.visible.where("created_at > ?", 1.day.ago).count * 10
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue