New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use actual reason count in historical accuracy check #742
Conversation
@@ -55,7 +55,7 @@ def autoflag | |||
fake_flag_condition = FlagCondition.new( | |||
sites: Site.mains, | |||
max_poster_rep: post.user_reputation, | |||
min_reason_count: 1, | |||
min_reason_count: len(post.reasons), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That... is not going to work. len
is not Ruby.
post_reasons_count = 0 | ||
post.reasons.each do |r| | ||
post_reasons_count += 1 | ||
fake_flag_condition = FlagCondition.new( | ||
sites: Site.mains, | ||
max_poster_rep: post.user_reputation, | ||
min_reason_count: 1, | ||
min_reason_count: post_reasons_count, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruby is not Python. You're writing Python-style Ruby, and... it's not going to work. You want post.reasons.count
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I used post.reasons.count
, and CI is not happy about it... On 9e77670
Will hopefully make db queries faster/more accurate.