search: replace calls to PostQueryBuilder#fast_count with PostQuery#fast_count.

Prepare a few more places for the new tag search parser.
This commit is contained in:
evazion
2022-03-30 01:35:48 -05:00
parent 8c9e045a9c
commit 6edff247f2
5 changed files with 12 additions and 8 deletions

View File

@@ -126,7 +126,7 @@ class TagImplication < TagRelationship
errors.add(:base, "'#{antecedent_name}' must have at least #{(MINIMUM_TAG_PERCENTAGE * consequent_tag.post_count).to_i} posts")
end
max_count = MAXIMUM_TAG_PERCENTAGE * PostQueryBuilder.new("~#{antecedent_name} ~#{consequent_name}").fast_count(timeout: 0).to_i
max_count = MAXIMUM_TAG_PERCENTAGE * PostQuery.new("~#{antecedent_name} ~#{consequent_name}").fast_count(timeout: 0).to_i
if antecedent_tag.post_count > max_count && max_count > 0
errors.add(:base, "'#{antecedent_name}' can't make up more than #{(MAXIMUM_TAG_PERCENTAGE * 100).to_i}% of '#{consequent_name}'")
end