Merge pull request #4294 from BrokenEagle/use-model-counts
User: Use model counts instead of SQL queries
This commit is contained in:
@@ -15,13 +15,13 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% t.column "Posts" do |user| %>
|
<% 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 %>
|
<% end %>
|
||||||
<% t.column "Deleted" do |user| %>
|
<% t.column "Deleted" do |user| %>
|
||||||
<%= user.posts.deleted.count %>
|
<%= user.posts.deleted.count %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% t.column "Notes" do |user| %>
|
<% 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 %>
|
<% end %>
|
||||||
<% t.column "Edits" do |user| %>
|
<% t.column "Edits" do |user| %>
|
||||||
<%= link_to user.post_update_count, post_versions_path(:search => {:updater_id => user.id}) %>
|
<%= link_to user.post_update_count, post_versions_path(:search => {:updater_id => user.id}) %>
|
||||||
|
|||||||
Reference in New Issue
Block a user