Change includes aspects to joins aspects
This commit is contained in:
parent
4e4e4d763a
commit
39b8fed431
1 changed files with 3 additions and 1 deletions
|
|
@ -79,7 +79,9 @@ module Diaspora
|
|||
def posts_from(person)
|
||||
asp = Aspect.arel_table
|
||||
p = Post.arel_table
|
||||
person.posts.includes(:aspects, :comments).where( p[:public].eq(true).or(asp[:user_id].eq(self.id))).select('DISTINCT `posts`.*').order("posts.created_at DESC")
|
||||
person.posts.joins(:aspects).includes(:comments).where(
|
||||
p[:public].eq(true).or(asp[:user_id].eq(self.id))
|
||||
).select('DISTINCT `posts`.*').order("posts.created_at DESC")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue