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:
parent
a604dd2aa6
commit
e951fa6a9c
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue