From 1ed737c3b9cc922943d874bc19558a0d6827edcd Mon Sep 17 00:00:00 2001 From: maxwell Date: Thu, 3 Feb 2011 16:15:51 -0800 Subject: [PATCH] make aspects a link, and remove a big db query from the view --- app/views/aspects/_aspect.haml | 2 +- app/views/aspects/_aspect_listings.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/aspects/_aspect.haml b/app/views/aspects/_aspect.haml index 4853ee5cf..12dfea2f6 100644 --- a/app/views/aspects/_aspect.haml +++ b/app/views/aspects/_aspect.haml @@ -3,7 +3,7 @@ %b = link_to t('contacts', :count => contacts.count), edit_aspect_path(aspect), :rel => 'facebox' %b - = aspect.name + = link_to aspect.name, edit_aspect_path(aspect), :rel => 'facebox' %br - if contacts.length > 0 diff --git a/app/views/aspects/_aspect_listings.haml b/app/views/aspects/_aspect_listings.haml index cee8dd402..ec22aa4ef 100644 --- a/app/views/aspects/_aspect_listings.haml +++ b/app/views/aspects/_aspect_listings.haml @@ -15,4 +15,4 @@ %ul - for aspect in aspects - = render 'aspects/aspect', :aspect => aspect, :contacts => aspect.contacts.where(:pending => false) + = render 'aspects/aspect', :aspect => aspect, :contacts => aspect.contacts.reject{|x| x.pending == true}