Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

user12986714
Copy link
Contributor

Will hopefully make db queries faster/more accurate.

@@ -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),
Copy link
Member

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.

Comment on lines 55 to 61
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,
Copy link
Member

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

Copy link
Contributor Author

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

@ArtOfCode- ArtOfCode- closed this Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants