Post.fast_count: fix incorrect counts for aliased tags.
Revert optimization from a6163258b. Turns out that we have to resolve
aliases in fast_count, otherwise for aliased tags we'll return an empty
count.
Fixes #4156.
This commit is contained in:
@@ -1115,7 +1115,7 @@ class Post < ApplicationRecord
|
||||
tags = tags.to_s
|
||||
tags += " rating:s" if CurrentUser.safe_mode?
|
||||
tags += " -status:deleted" if CurrentUser.hide_deleted_posts? && !Tag.has_metatag?(tags, "status", "-status")
|
||||
tags = Tag.normalize_query(tags, normalize_aliases: false)
|
||||
tags = Tag.normalize_query(tags)
|
||||
|
||||
# optimize some cases. these are just estimates but at these
|
||||
# quantities being off by a few hundred doesn't matter much
|
||||
|
||||
Reference in New Issue
Block a user