Don't call aspects_with_post more than once, we can find a prettier place to cache it later

This commit is contained in:
Raphael Sofaer 2011-08-10 10:31:10 -07:00
parent ccecf32f9b
commit cd0fca8462

View file

@ -41,20 +41,21 @@
= t('public')
·
- else
- aspects = aspects_with_post(all_aspects, post)
- if post.author.owner_id == current_user.id
%span.post_scope{:title => t('.shared_with', :aspect_names => aspects_with_post(all_aspects, post).map!{|a| a.name}.join(', '))}
- if aspects_with_post(all_aspects, post).size == 1
= aspects_with_post(all_aspects, post).first
%span.post_scope{:title => t('.shared_with', :aspect_names => aspects.map!{|a| a.name}.join(', '))}
- if aspects.size == 1
= aspects.first
- else
= t('limited')
(#{aspects_with_post(all_aspects, post).size})
(#{aspects.size})
- else
%span.post_scope
- if aspects_with_post(all_aspects, post).size == 1
= aspects_with_post(all_aspects, post).first
- if aspects.size == 1
= aspects.first
- else
= t('limited')
(#{aspects_with_post(all_aspects, post).size})
(#{aspects.size})
·
%span.via