Commit c330e5cc8f26ffcd0380c9614e17778de6cc8091
1 parent
4ba820dd
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Fix more comments action from network tab
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
app/controllers/public/profile_controller.rb
| @@ -207,7 +207,10 @@ class ProfileController < PublicController | @@ -207,7 +207,10 @@ class ProfileController < PublicController | ||
| 207 | 207 | ||
| 208 | def more_comments | 208 | def more_comments |
| 209 | profile_filter = @profile.person? ? {:user_id => @profile} : {:target_id => @profile} | 209 | profile_filter = @profile.person? ? {:user_id => @profile} : {:target_id => @profile} |
| 210 | - activity = ActionTracker::Record.find(:first, :conditions => {:id => params[:activity]}.merge(profile_filter)) | 210 | + activity = ActionTracker::Record.where(:id => params[:activity]) |
| 211 | + activity = activity.where(profile_filter) if !logged_in? || !current_person.follows?(@profile) | ||
| 212 | + activity = activity.first | ||
| 213 | + | ||
| 211 | comments_count = activity.comments.count | 214 | comments_count = activity.comments.count |
| 212 | comment_page = (params[:comment_page] || 1).to_i | 215 | comment_page = (params[:comment_page] || 1).to_i |
| 213 | comments_per_page = 5 | 216 | comments_per_page = 5 |