From 10141742e50e3c270000eae656984384ee067a5e Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Thu, 9 Dec 2010 15:53:14 -0800 Subject: [PATCH] Doing the query in mongo --- app/models/user.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 438634d99..849d50355 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -240,9 +240,10 @@ class User def push_to_aspects(post, aspects) #send to the aspects - target_contacts = aspects.inject([]) { |contacts,aspect| - contacts = contacts | aspect.contacts - } + # + target_aspect_ids = aspects.map {|a| a.id} + + target_contacts = Contact.all(:aspect_ids.in => target_aspect_ids) post_to_hub(post) if post.respond_to?(:public) && post.public push_to_people(post, self.person_objects(target_contacts))