From f13f9e7163cf32756c48e3681ad7647009af345e Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 2 Mar 2017 16:48:16 -0600 Subject: [PATCH] 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. --- app/views/post_versions/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/post_versions/index.html.erb b/app/views/post_versions/index.html.erb index c249f7329..8303e0fe6 100644 --- a/app/views/post_versions/index.html.erb +++ b/app/views/post_versions/index.html.erb @@ -2,7 +2,7 @@

Changes

- <% if @post_versions.empty? %> + <% if @post_versions.length == 0 %> <%= render "post_sets/blank" %> <% else %> <%= render "listing", :post_versions => @post_versions %>