post_versions/index.html.erb:5: avoid extraneous COUNT.

@post_versions.empty? caused this query:

    SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "post_versions" WHERE (true) LIMIT 20 OFFSET 0) subquery_for_count

which is unnecessary since @post_versions can be counted directly.
This commit is contained in:
evazion
2017-03-02 16:48:16 -06:00
parent 3db7244109
commit f13f9e7163

View File

@@ -2,7 +2,7 @@
<div id="a-index">
<h1>Changes</h1>
<% if @post_versions.empty? %>
<% if @post_versions.length == 0 %>
<%= render "post_sets/blank" %>
<% else %>
<%= render "listing", :post_versions => @post_versions %>