avoid extra COUNT queries for loaded Relations
This commit is contained in:
parent
9a60692dce
commit
9faf46b0cf
|
@ -3,7 +3,7 @@
|
|||
Requested Hats
|
||||
</div>
|
||||
|
||||
<% if @hat_requests.count == 0 %>
|
||||
<% if @hat_requests.length == 0 %>
|
||||
No hat requests.
|
||||
<% else %>
|
||||
<% @hat_requests.each_with_index do |hr,x| %>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<div class="box">
|
||||
Stories with <a href="/tags">tags</a> in the
|
||||
<% @categories.each do |c| %>
|
||||
<%= link_to c.category, category_path(c) %>
|
||||
<% end %>
|
||||
<%= "category".pluralize(@categories) %>
|
||||
|
||||
<%= render(partial: 'categories/multi_category_tip') if @categories.length == 1 %>
|
||||
</div>
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @invitation_requests.count == 0 %>
|
||||
<% if @invitation_requests.length == 0 %>
|
||||
<tr>
|
||||
<td colspan=<%= @user.is_moderator?? 5 : 4 %> align="center"><span
|
||||
class="na">No invitation requests</span></td>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<p class="help">No replies to show.</p>
|
||||
<% end %>
|
||||
|
||||
<% if @replies.count > RepliesController::REPLIES_PER_PAGE && @filter != 'unread'%>
|
||||
<% if @replies.length > RepliesController::REPLIES_PER_PAGE && @filter != 'unread'%>
|
||||
<div class="morelink">
|
||||
<% if @page && @page > 1 %>
|
||||
<a href="/replies<%= @page == 2 ? "" : "/page/#{@page - 1}" %>"><<
|
||||
|
|
Loading…
Reference in New Issue