From 8b4aab0780eb3bafa399f2938c2f5311cdb59173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabi=C3=A1n=20Rodr=C3=ADguez?= Date: Tue, 15 Jan 2013 01:10:30 -0200 Subject: [PATCH] change #count to #size in notifications_helper to reduce queries --- app/helpers/notifications_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 13808fc6f..42bf14244 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -3,7 +3,7 @@ module NotificationsHelper def object_link(note, actors) target_type = note.popup_translation_key - actors_count = note.actors.count + actors_count = note.actors.size if note.instance_of?(Notifications::Mentioned) if post = note.linked_object @@ -29,7 +29,7 @@ module NotificationsHelper def notification_people_link(note, people=nil) actors =people || note.actors - number_of_actors = actors.count + number_of_actors = actors.size sentence_translations = {:two_words_connector => " #{t('notifications.index.and')} ", :last_word_connector => ", #{t('notifications.index.and')} " } actor_links = actors.collect{ |person| person_link(person, :class => 'hovercardable')