Commit 64cf718401e6fcab9572e72d7534fb0b2b224006
1 parent
24c27953
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Fix problem when listing profiles with included relations
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
app/controllers/public/profile_controller.rb
@@ -55,7 +55,7 @@ class ProfileController < PublicController | @@ -55,7 +55,7 @@ class ProfileController < PublicController | ||
55 | 55 | ||
56 | def communities | 56 | def communities |
57 | if is_cache_expired?(profile.communities_cache_key(params)) | 57 | if is_cache_expired?(profile.communities_cache_key(params)) |
58 | - @communities = profile.communities.includes(relations_to_include).paginate(:per_page => per_page, :page => params[:npage], :total_entries => profile.communities.count) | 58 | + @communities = profile.communities.paginate(:per_page => per_page, :page => params[:npage], :total_entries => profile.communities.count).includes(relations_to_include) |
59 | end | 59 | end |
60 | end | 60 | end |
61 | 61 | ||
@@ -65,13 +65,13 @@ class ProfileController < PublicController | @@ -65,13 +65,13 @@ class ProfileController < PublicController | ||
65 | 65 | ||
66 | def friends | 66 | def friends |
67 | if is_cache_expired?(profile.friends_cache_key(params)) | 67 | if is_cache_expired?(profile.friends_cache_key(params)) |
68 | - @friends = profile.friends.includes(relations_to_include).paginate(:per_page => per_page, :page => params[:npage]) | 68 | + @friends = profile.friends.paginate(:per_page => per_page, :page => params[:npage]).includes(relations_to_include) |
69 | end | 69 | end |
70 | end | 70 | end |
71 | 71 | ||
72 | def members | 72 | def members |
73 | if is_cache_expired?(profile.members_cache_key(params)) | 73 | if is_cache_expired?(profile.members_cache_key(params)) |
74 | - @members = profile.members_by_name.includes(relations_to_include).paginate(:per_page => members_per_page, :page => params[:npage]) | 74 | + @members = profile.members_by_name.paginate(:per_page => members_per_page, :page => params[:npage]).includes(relations_to_include) |
75 | end | 75 | end |
76 | end | 76 | end |
77 | 77 |