posts: move fast_count to PostQueryBuilder.

This commit is contained in:
evazion
2020-05-06 14:47:16 -05:00
parent d3bd0a9cb5
commit a753ebbea9
9 changed files with 206 additions and 234 deletions

View File

@@ -76,7 +76,7 @@ class UserPresenter
end
def commented_posts_count(template)
count = CurrentUser.without_safe_mode { Post.fast_count("commenter:#{user.name}") }
count = CurrentUser.without_safe_mode { PostQueryBuilder.new("commenter:#{user.name}").fast_count }
count = "?" if count.nil?
template.link_to(count, template.posts_path(:tags => "commenter:#{user.name} order:comment_bumped"))
end
@@ -90,7 +90,7 @@ class UserPresenter
end
def noted_posts_count(template)
count = CurrentUser.without_safe_mode { Post.fast_count("noteupdater:#{user.name}") }
count = CurrentUser.without_safe_mode { PostQueryBuilder.new("noteupdater:#{user.name}").fast_count }
count = "?" if count.nil?
template.link_to(count, template.posts_path(:tags => "noteupdater:#{user.name} order:note"))
end