diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-01 16:26:25 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-01 16:26:25 +0100 |
commit | 1d0321fc4556b947c8b3482d7bef631b0ccf038b (patch) | |
tree | 32fd569f3b8324fe30506aa5894d3f8661d5a56c /app/controllers/accounts_controller.rb | |
parent | bdf7d8f8fd09dfa3a9182c575a3101c73ecc543f (diff) |
Fix pt translations, improve pre-cache queries, removing will_paginate
from accounts/tags because it's a terribly inefficient way to paginate large sets of data
Diffstat (limited to 'app/controllers/accounts_controller.rb')
-rw-r--r-- | app/controllers/accounts_controller.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 5d2f4eee0..b0e5a8320 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -9,7 +9,8 @@ class AccountsController < ApplicationController def show respond_to do |format| format.html do - @statuses = @account.statuses.order('id desc').with_includes.with_counters.paginate(page: params[:page], per_page: 10) + @statuses = @account.statuses.order('id desc').paginate_by_max_id(20, params[:max_id || nil]) + @statuses = cache_collection(@statuses, Status) end format.atom do @@ -29,11 +30,11 @@ class AccountsController < ApplicationController end def followers - @followers = @account.followers.order('follows.created_at desc').paginate(page: params[:page], per_page: 6) + @followers = @account.followers.order('follows.created_at desc').paginate(page: params[:page], per_page: 12) end def following - @following = @account.following.order('follows.created_at desc').paginate(page: params[:page], per_page: 6) + @following = @account.following.order('follows.created_at desc').paginate(page: params[:page], per_page: 12) end private |