From 56087561a08b0654793f39f6d9e1a4382f2695bf Mon Sep 17 00:00:00 2001 From: BrokenEagle Date: Sat, 15 Feb 2020 19:42:12 +0000 Subject: [PATCH] User: Use model counts instead of SQL queries --- app/views/users/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 60ebbd573..d7c051cae 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -15,13 +15,13 @@ <% end %> <% end %> <% t.column "Posts" do |user| %> - <%= link_to user.posts.count, posts_path(:tags => "user:#{user.name}") %> + <%= link_to user.post_upload_count, posts_path(:tags => "user:#{user.name}") %> <% end %> <% t.column "Deleted" do |user| %> <%= user.posts.deleted.count %> <% end %> <% t.column "Notes" do |user| %> - <%= link_to user.note_versions.count, note_versions_path(:search => {:updater_id => user.id}) %> + <%= link_to user.note_update_count, note_versions_path(:search => {:updater_id => user.id}) %> <% end %> <% t.column "Edits" do |user| %> <%= link_to user.post_update_count, post_versions_path(:search => {:updater_id => user.id}) %>