about summary refs log tree commit diff
path: root/app/controllers/following_accounts_controller.rb
diff options
context:
space:
mode:
authoralpaca-tc <alpaca-tc@alpaca.tc>2017-05-06 11:03:07 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-05-06 04:03:07 +0200
commitddc34feb5875fd247fc7331b7710406d6de4a143 (patch)
tree5a1b654b9974ac1a5549bed6faa7abe8d92c4dfc /app/controllers/following_accounts_controller.rb
parent3f5b994ff0674fa8e0e5676ca22f0c347f9d7712 (diff)
Optimize follower_accounts and following_accounts (#2820)
Diffstat (limited to 'app/controllers/following_accounts_controller.rb')
-rw-r--r--app/controllers/following_accounts_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/following_accounts_controller.rb b/app/controllers/following_accounts_controller.rb
index 0a8062680..925647864 100644
--- a/app/controllers/following_accounts_controller.rb
+++ b/app/controllers/following_accounts_controller.rb
@@ -4,6 +4,6 @@ class FollowingAccountsController < ApplicationController
   include AccountControllerConcern
 
   def index
-    @accounts = @account.following.page(params[:page]).per(FOLLOW_PER_PAGE)
+    @follows = Follow.where(account: @account).order(id: :desc).page(params[:page]).per(FOLLOW_PER_PAGE).preload(:target_account)
   end
 end