temp fix for pagination. photos index fix
This commit is contained in:
parent
c9d5a15bf8
commit
b3cb8e0a2b
3 changed files with 3 additions and 4 deletions
|
|
@ -26,7 +26,7 @@ class AspectsController < ApplicationController
|
|||
|
||||
@selected_contacts = @aspects.map { |aspect| aspect.contacts }.flatten.uniq
|
||||
@aspect_ids = @aspects.map { |a| a.id }
|
||||
@posts = current_user.raw_visible_posts(:by_members_of => @aspect_ids, :type => 'StatusMessage', :order => session[:sort_order] + ' DESC').includes(
|
||||
@posts = current_user.raw_visible_posts(:by_members_of => @aspect_ids, :type => 'StatusMessage', :order => session[:sort_order] + ' DESC', :page => params[:page]).includes(
|
||||
:comments, :mentions, :likes, :dislikes).paginate(:page => params[:page], :per_page => 15, :order => session[:sort_order] + ' DESC')
|
||||
@fakes = PostsFake.new(@posts)
|
||||
|
||||
|
|
|
|||
|
|
@ -28,9 +28,7 @@ class PhotosController < ApplicationController
|
|||
@contacts_of_contact = []
|
||||
end
|
||||
|
||||
@posts = current_user.visible_photos.where(
|
||||
:author_id => @person.id
|
||||
).paginate(:page => params[:page])
|
||||
@posts = current_user.posts_from(@person).where(:type => 'Photo').paginate(:page => params[:page])
|
||||
|
||||
render 'people/show'
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ module Diaspora
|
|||
opts[:limit] ||= 20
|
||||
opts[:order] ||= 'updated_at DESC'
|
||||
opts[:order] = '`posts`.' + opts[:order]
|
||||
opts[:limit] = opts[:limit] * opts[:page] if opts[:page]
|
||||
|
||||
posts_from_others = Post.joins(:contacts).where(:contacts => {:user_id => self.id})
|
||||
posts_from_self = self.person.posts.joins(:aspect_visibilities => :aspect).where(:aspects => {:user_id => self.id})
|
||||
|
|
|
|||
Loading…
Reference in a new issue