Use Post#reshare_count in the view so that we take advantage of the memoization instead of hitting the DB more than necessary.

This commit is contained in:
Pistos 2011-10-04 13:54:42 -04:00
parent a604dd2aa6
commit e951fa6a9c

View file

@ -32,7 +32,7 @@
%span.timeago
= link_to(how_long_ago(post), post_path(post))
- if post.reshares.any?
- if post.reshare_count > 0
%span.num_reshares
= t("reshares.reshare.reshare", :count => post.reshares.size)