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