Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eliminate n+1 query of subscription tagname method #8268

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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