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
This commit is contained in:
Eugen Rochko
2016-12-01 16:26:25 +01:00
parent bdf7d8f8fd
commit 1d0321fc45
10 changed files with 21 additions and 15 deletions

View File

@ -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