diff --git a/app/controllers/follower_accounts_controller.rb b/app/controllers/follower_accounts_controller.rb index 25c7a893a08fab0c5aaebbc6693880f0e0c26a9e..d56bd2a4dd43cd36e0fb94d89dd73917f32876c3 100644 --- a/app/controllers/follower_accounts_controller.rb +++ b/app/controllers/follower_accounts_controller.rb @@ -4,6 +4,6 @@ class FollowerAccountsController < ApplicationController include AccountControllerConcern def index - @accounts = @account.followers.page(params[:page]).per(FOLLOW_PER_PAGE) + @follows = Follow.where(target_account: @account).order(id: :desc).page(params[:page]).per(FOLLOW_PER_PAGE).preload(:account) end end diff --git a/app/controllers/following_accounts_controller.rb b/app/controllers/following_accounts_controller.rb index 0a80626809fc692c891d7e2452beb524ef756650..925647864467df9328dbe9bcd05e791c2272ea8b 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 diff --git a/app/views/accounts/_follow_grid.html.haml b/app/views/accounts/_follow_grid.html.haml index 322a0ebf4e1aeba3ac1fe78673431321bcbff91e..10fbfa546dbbab77b7a3e3959d4705f872641a3e 100644 --- a/app/views/accounts/_follow_grid.html.haml +++ b/app/views/accounts/_follow_grid.html.haml @@ -4,4 +4,4 @@ - else = render partial: 'accounts/grid_card', collection: accounts, as: :account, cached: true -= paginate accounts += paginate follows diff --git a/app/views/follower_accounts/index.html.haml b/app/views/follower_accounts/index.html.haml index ee62c79ebfc3bdc0ac4ad1541ac0d7137d48e340..89c7f3a29476908442de780c257ca2d7519e88ee 100644 --- a/app/views/follower_accounts/index.html.haml +++ b/app/views/follower_accounts/index.html.haml @@ -6,4 +6,4 @@ = render 'accounts/header', account: @account -= render 'accounts/follow_grid', accounts: @accounts += render 'accounts/follow_grid', follows: @follows, accounts: @follows.map(&:account) diff --git a/app/views/following_accounts/index.html.haml b/app/views/following_accounts/index.html.haml index 68a0ef8389b1cf1fcb327f4ebaa90e63a51d8525..6f0de7590ba5a5ebe0254c58a7ea91959bf194ec 100644 --- a/app/views/following_accounts/index.html.haml +++ b/app/views/following_accounts/index.html.haml @@ -6,4 +6,4 @@ = render 'accounts/header', account: @account -= render 'accounts/follow_grid', accounts: @accounts += render 'accounts/follow_grid', follows: @follows, accounts: @follows.map(&:target_account)