change #count to #size in notifications_helper to reduce queries
This commit is contained in:
parent
d4d3bf8af6
commit
8b4aab0780
1 changed files with 2 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ module NotificationsHelper
|
||||||
|
|
||||||
def object_link(note, actors)
|
def object_link(note, actors)
|
||||||
target_type = note.popup_translation_key
|
target_type = note.popup_translation_key
|
||||||
actors_count = note.actors.count
|
actors_count = note.actors.size
|
||||||
|
|
||||||
if note.instance_of?(Notifications::Mentioned)
|
if note.instance_of?(Notifications::Mentioned)
|
||||||
if post = note.linked_object
|
if post = note.linked_object
|
||||||
|
|
@ -29,7 +29,7 @@ module NotificationsHelper
|
||||||
|
|
||||||
def notification_people_link(note, people=nil)
|
def notification_people_link(note, people=nil)
|
||||||
actors =people || note.actors
|
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')} " }
|
sentence_translations = {:two_words_connector => " #{t('notifications.index.and')} ", :last_word_connector => ", #{t('notifications.index.and')} " }
|
||||||
actor_links = actors.collect{ |person|
|
actor_links = actors.collect{ |person|
|
||||||
person_link(person, :class => 'hovercardable')
|
person_link(person, :class => 'hovercardable')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue