Avoiding SQL queries by using .length instead of .count after eager-loading

This commit is contained in:
Christoph Haas 2013-08-08 20:32:34 +02:00
parent 928a39dcea
commit ca78fbabd4

View file

@ -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>