do includes before last(3), as last() returns an array, not an AR object

This commit is contained in:
danielgrippi 2011-11-04 16:46:16 -07:00
parent 3cfa0c4602
commit 39b6abaa88

View file

@ -9,7 +9,7 @@
%ul.comments{:class => ('loaded' if post.comments.size <= 3)} %ul.comments{:class => ('loaded' if post.comments.size <= 3)}
-if post.comments.size > 3 && !comments_expanded && ! all_comments? -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 -else
= render :partial => 'comments/comment', :collection => post.comments.including_author, :locals => {:post => post} = render :partial => 'comments/comment', :collection => post.comments.including_author, :locals => {:post => post}