Change person show page to created_at ordering, since you're looking at that person's content
This commit is contained in:
parent
fbfd46a506
commit
9f368bf82f
2 changed files with 3 additions and 3 deletions
|
|
@ -68,10 +68,10 @@ class PeopleController < ApplicationController
|
||||||
else
|
else
|
||||||
@commenting_disabled = false
|
@commenting_disabled = false
|
||||||
end
|
end
|
||||||
@posts = current_user.posts_from(@person).where(:type => "StatusMessage").paginate(:per_page => 15, :page => params[:page], :order => 'posts.created_at DESC')
|
@posts = current_user.posts_from(@person).where(:type => "StatusMessage").paginate(:per_page => 15, :page => params[:page])
|
||||||
else
|
else
|
||||||
@commenting_disabled = true
|
@commenting_disabled = true
|
||||||
@posts = @person.posts.where(:type => "StatusMessage", :public => true).paginate(:per_page => 15, :page => params[:page], :order => 'updated_at DESC')
|
@posts = @person.posts.where(:type => "StatusMessage", :public => true).paginate(:per_page => 15, :page => params[:page], :order => 'created_at DESC')
|
||||||
end
|
end
|
||||||
|
|
||||||
@fakes = PostsFake.new(@posts)
|
@fakes = PostsFake.new(@posts)
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ module Diaspora
|
||||||
def posts_from(person)
|
def posts_from(person)
|
||||||
asp = Aspect.arel_table
|
asp = Aspect.arel_table
|
||||||
p = Post.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.updated_at DESC")
|
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")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue