only cache notes if a post has notes

This commit is contained in:
r888888888
2017-11-21 14:46:10 -08:00
parent 5b3f3622f7
commit 3e6cb67c57

View File

@@ -102,8 +102,10 @@
</section>
<section id="notes" style="display: none;">
<% cache("p/#{@post.id}/n/#{@post.last_noted_at.to_i}") do %>
<%= render :partial => "notes/note", :collection => @post.notes.active %>
<% if @post.has_notes? %>
<% cache("p/#{@post.id}/n/#{@post.last_noted_at.to_i}") do %>
<%= render :partial => "notes/note", :collection => @post.notes.active %>
<% end %>
<% end %>
</section>