removed unused method; moved includes() out of scope

This commit is contained in:
danielgrippi 2011-09-13 23:12:01 -07:00
parent 88688d9bb6
commit aed08d6283
3 changed files with 2 additions and 6 deletions

View file

@ -55,7 +55,7 @@ class Person < ActiveRecord::Base
joins(:contacts => :aspect_memberships). joins(:contacts => :aspect_memberships).
where(:contacts => {:user_id => user.id}, where(:contacts => {:user_id => user.id},
:aspect_memberships => {:aspect_id => aspect_ids}). :aspect_memberships => {:aspect_id => aspect_ids}).
select("DISTINCT people.*").includes(:profile) select("DISTINCT people.*")
} }
def self.featured_users def self.featured_users

View file

@ -51,7 +51,7 @@ class AspectStream
# @return [ActiveRecord::Association<Person>] AR association of people within stream's given aspects # @return [ActiveRecord::Association<Person>] AR association of people within stream's given aspects
def people def people
@people ||= Person.all_from_aspects(aspect_ids, @user) @people ||= Person.all_from_aspects(aspect_ids, @user).includes(:profile)
end end
# The first aspect in #aspects, given the stream is not for all aspects, or #aspects size is 1 # The first aspect in #aspects, given the stream is not for all aspects, or #aspects size is 1

View file

@ -95,10 +95,6 @@ module Diaspora
end end
end end
def all_aspect_ids
self.aspects.all.collect{|x| x.id}
end
def posts_from(person) def posts_from(person)
return self.person.posts.where(:pending => false).order("created_at DESC") if person == self.person return self.person.posts.where(:pending => false).order("created_at DESC") if person == self.person
con = Contact.arel_table con = Contact.arel_table