From 0c0fadaa7a7a13626d7d2ad0b2744b1050743bcc Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 31 Jul 2014 14:32:27 -0300 Subject: [PATCH] Fix comment pagination in profile wall --- app/controllers/public/profile_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index 0909c53..69e087d 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -202,7 +202,8 @@ class ProfileController < PublicController end def more_comments - activity = ActionTracker::Record.find(:first, :conditions => {:id => params[:activity], :user_id => @profile}) + profile_filter = @profile.person? ? {:user_id => @profile} : {:target_id => @profile} + activity = ActionTracker::Record.find(:first, :conditions => {:id => params[:activity]}.merge(profile_filter)) comments_count = activity.comments.count comment_page = (params[:comment_page] || 1).to_i comments_per_page = 5 -- libgit2 0.21.2