diff --git a/app/models/person.rb b/app/models/person.rb index a36784532..4cc3e723a 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -55,7 +55,7 @@ class Person < ActiveRecord::Base joins(:contacts => :aspect_memberships). where(:contacts => {:user_id => user.id}, :aspect_memberships => {:aspect_id => aspect_ids}). - select("DISTINCT people.*").includes(:profile) + select("DISTINCT people.*") } def self.featured_users diff --git a/lib/aspect_stream.rb b/lib/aspect_stream.rb index 3ba121c8b..ec5404600 100644 --- a/lib/aspect_stream.rb +++ b/lib/aspect_stream.rb @@ -51,7 +51,7 @@ class AspectStream # @return [ActiveRecord::Association] AR association of people within stream's given aspects def people - @people ||= Person.all_from_aspects(aspect_ids, @user) + @people ||= Person.all_from_aspects(aspect_ids, @user).includes(:profile) end # The first aspect in #aspects, given the stream is not for all aspects, or #aspects size is 1 diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index c34c0a37b..a3c9e555c 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -95,10 +95,6 @@ module Diaspora end end - def all_aspect_ids - self.aspects.all.collect{|x| x.id} - end - def posts_from(person) return self.person.posts.where(:pending => false).order("created_at DESC") if person == self.person con = Contact.arel_table