Fix person show

This commit is contained in:
Raphael 2011-01-17 14:30:57 -08:00
parent a7e30adc28
commit db417abc18

View file

@ -72,7 +72,7 @@ module Diaspora
def posts_from(person)
asp = Aspect.arel_table
p = Post.arel_table
Post.includes(:aspects).where( p[:public].eq(true).or(asp[:user_id].eq(self.id))).order("posts.updated_at DESC")
person.posts.includes(:aspects).where( p[:public].eq(true).or(asp[:user_id].eq(self.id))).select('DISTINCT `posts`.*').order("posts.updated_at DESC")
end
end
end