Avoiding SQL queries by using .length instead of .count after eager-loading
This commit is contained in:
parent
928a39dcea
commit
ca78fbabd4
1 changed files with 1 additions and 1 deletions
|
|
@ -5,7 +5,7 @@
|
|||
<% @packages.each do |package| %>
|
||||
<h2><%= package.name %></h2>
|
||||
<li>
|
||||
<% if package.screenshots.count>0 %>
|
||||
<% if package.screenshots.length>0 %>
|
||||
<%= image_tag package.screenshots.first.image_url('small') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue