diff --git a/app/models/person.rb b/app/models/person.rb index a367845327f0ab69ca00e3981ee4fa4ef138387c..4cc3e723aabaddad73447726ebe46dca2b3ccbba 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 3ba121c8b2703b0176063da3890efa0b0d1fc7c3..ec5404600a50c26d8660c04e35025fc7fd60ed99 100644 --- a/lib/aspect_stream.rb +++ b/lib/aspect_stream.rb @@ -51,7 +51,7 @@ class AspectStream # @return [ActiveRecord::Association<Person>] 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 c34c0a37be6ad22340bf5fdf811e4217a92066d9..a3c9e555c6ffc9d15f2207c0297f007d12e37086 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