From 9469d67efda0086dd42b86dadcc2328e63f0a950 Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Wed, 8 Aug 2012 11:31:32 +0100 Subject: [PATCH] Use count rather than size to count posts efficiently --- app/views/feeds/index.html.haml | 2 +- app/views/feeds/show.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/feeds/index.html.haml b/app/views/feeds/index.html.haml index b7e6085..f7d47d4 100644 --- a/app/views/feeds/index.html.haml +++ b/app/views/feeds/index.html.haml @@ -17,7 +17,7 @@ %td .feed_title = link_to f.title, f - %td.right= f.posts.size + %td.right= f.posts.count %td - if f.last_fetched.nil? never diff --git a/app/views/feeds/show.html.haml b/app/views/feeds/show.html.haml index f29473b..47e981b 100644 --- a/app/views/feeds/show.html.haml +++ b/app/views/feeds/show.html.haml @@ -9,7 +9,7 @@ Validate %p - = pluralize(@feed.posts.size, "post") + = pluralize(@feed.posts.count, "post") %p = link_to @feed.feed_url, @feed.feed_url