Unsuccessful attempt to properly eager load screenshots.
Currently the virtual attribute "image_url" in the screenshots model apparently runs one SQL query each to get the packages data.
This commit is contained in:
parent
88dfb33721
commit
76d19f7e78
3 changed files with 14 additions and 8 deletions
|
|
@ -5,9 +5,7 @@
|
|||
<ul>
|
||||
<% @packages.each do |package| %>
|
||||
<li>
|
||||
<%= package.name %> <i>(<%= package.description %>)</i>
|
||||
- has <%= package.screenshots.count %> screenshots
|
||||
<% if package.screenshots.count>0 %>
|
||||
<% if package.screenshots %>
|
||||
<%= image_tag package.screenshots.first.image_url('small') %>
|
||||
<% end %>
|
||||
</li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue