diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb index 200a113ad..377b85d81 100644 --- a/app/presenters/user_presenter.rb +++ b/app/presenters/user_presenter.rb @@ -70,8 +70,7 @@ class UserPresenter end def commented_posts_count(template) - count = PostQuery.new("commenter:#{user.name}").fast_count - count = "?" if count.nil? + count = user.comments.distinct.count(:post_id) template.link_to(count, template.posts_path(tags: "commenter:#{user.name} order:comment_bumped"), rel: "nofollow") end @@ -84,8 +83,7 @@ class UserPresenter end def noted_posts_count(template) - count = PostQuery.new("noteupdater:#{user.name}").fast_count - count = "?" if count.nil? + count = user.note_versions.distinct.count(:post_id) template.link_to(count, template.posts_path(tags: "noteupdater:#{user.name} order:note"), rel: "nofollow") end