Commit b58e7667

mo khan <mo@mokhan.ca>
2014-05-22 04:50:39
fix select n+1 problem.
1 parent e49bef1
Changed files (2)
app/views/my/dashboard/_creation.html.erb
@@ -13,7 +13,7 @@
       <i class="icon-plus"> images</i>
     <% end %>
     <%= link_to creation_favorites_path(:creation_id => item.id) do %>
-      <i class="icon-heart"> fanclub (<%=  pluralize(item.favorites.length, 'fan') %>)</i>
+      <i class="icon-heart"> fanclub </i>
     <% end %>
     <%= link_to creation_path(item), confirm: "Are you sure you want to permanently remove this creation?", method: :delete  do %>
       <i class="icon-white icon-remove"> remove</i>
app/views/my/dashboard/index.html.erb
@@ -7,8 +7,12 @@
     <% end %>
   </div>
   <div class="span5">
-    <% @activities.each do |activity| %>
-      <%= render "activities/#{activity.subject.class.to_s.downcase}", subject: activity.subject %>
+    <% if @activities.empty? %>
+      <p>No new activity to report.</p>
+    <% else %>
+      <% @activities.each do |activity| %>
+        <%= render "activities/#{activity.subject.class.to_s.downcase}", subject: activity.subject %>
+      <% end %>
     <% end %>
   </div>
 </div>