Skip to content

Commit 27edbf5

Browse files
committed
optimize image upload queries
1 parent 608e824 commit 27edbf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/views/content/cards/_in_universe_content_list.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
%>
66
<div class="card hoverable">
77
<div class="card-image">
8-
<% images = ImageUpload.where(content_type: content_type_name, content_id: content_list.map(&:id)) %>
8+
<% images = ImageUpload.where(content_type: content_type_name, content_id: content_list.pluck(:id)) %>
99
<% if images.any? && rand(3) < 2 %>
1010
<%= image_tag images.sample.src(:large), class: 'activator', style: 'height: 265px' %>
1111
<% else %>

0 commit comments

Comments
 (0)