Skip to content

Commit

Permalink
eliminate n+1 query of subscription tagname method (#8268)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlazypanda authored Aug 11, 2020
1 parent b11a822 commit 4452195
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/home/subscriptions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="col-lg-3">

<p><b><%=raw translation('home.subscriptions.title') %></b> <%=raw translation('home.subscriptions.up_to_date_emails') %></p>

<hr />
<p>
<a href="/subscriptions/digest" class="btn btn-outline-secondary"><i class="fa fa-list"></i> Subscriptions digest</a>
Expand Down Expand Up @@ -60,7 +60,7 @@
<% else %>
<table class="table">
<tr><th><%=raw translation('home.subscriptions.tag') %></th><th><%=raw translation('home.subscriptions.options') %></th></tr>
<% current_user.subscriptions(:tag).each do |subscription| %>
<% current_user.subscriptions(:tag).includes(:tag).each do |subscription| %>
<tr>
<td><a href="/tag/<%= subscription.tagname %>"><%= subscription.tagname %></a> <i style="color:#aaa;"> +<%= Tag.follower_count(subscription.tagname).to_i-1 %> other people</i></td>
<td><div class="btn-toolbar" style="margin:0;">
Expand Down

0 comments on commit 4452195

Please sign in to comment.