From 39b6abaa886ab4081c3a353580509f90da99001a Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Fri, 4 Nov 2011 16:46:16 -0700 Subject: [PATCH] do includes before last(3), as last() returns an array, not an AR object --- app/views/comments/_comments.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/comments/_comments.html.haml b/app/views/comments/_comments.html.haml index 5f7d79c45..a16f10481 100644 --- a/app/views/comments/_comments.html.haml +++ b/app/views/comments/_comments.html.haml @@ -9,7 +9,7 @@ %ul.comments{:class => ('loaded' if post.comments.size <= 3)} -if post.comments.size > 3 && !comments_expanded && ! all_comments? - = render :partial => 'comments/comment', :collection => post.comments.last(3).including_author, :locals => {:post => post} + = render :partial => 'comments/comment', :collection => post.comments.including_author.last(3), :locals => {:post => post} -else = render :partial => 'comments/comment', :collection => post.comments.including_author, :locals => {:post => post}