Improve User#posts_from
This commit is contained in:
parent
79b613b0e5
commit
6eb0dfb43f
2 changed files with 2 additions and 1 deletions
|
|
@ -72,7 +72,7 @@ module Diaspora
|
|||
def posts_from(person)
|
||||
asp = Aspect.arel_table
|
||||
p = Post.arel_table
|
||||
Post.joins(:aspects).where( p[:public].eq(true).or(asp[:user_id].eq(self.id))).order("updated_at DESC")
|
||||
Post.includes(:aspects).where( p[:public].eq(true).or(asp[:user_id].eq(self.id))).order("posts.updated_at DESC")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -216,6 +216,7 @@ describe PeopleController do
|
|||
status_message = user2.post(:status_message, :message => "hey there", :to => 'all', :public => true)
|
||||
|
||||
get :show, :id => user2.person.id
|
||||
assigns[:posts].should include status_message
|
||||
response.body.should include status_message.message
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue