From cdacac8c6cbd85ed6e8a1cac8ce6fa5994094c7c Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Sun, 1 Oct 2017 06:06:09 +0900 Subject: Fix order of paginated accounts in FollowerDomainsController and spec (#3357) * Fix order of paginated accounts in FollowerDomainsController Unordered pagination could result in unexpected behavior. * Cover Settings::FollowerDomainsController more --- app/controllers/settings/follower_domains_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/settings/follower_domains_controller.rb b/app/controllers/settings/follower_domains_controller.rb index 90b48887f..9968504e5 100644 --- a/app/controllers/settings/follower_domains_controller.rb +++ b/app/controllers/settings/follower_domains_controller.rb @@ -9,7 +9,7 @@ class Settings::FollowerDomainsController < ApplicationController def show @account = current_account - @domains = current_account.followers.reorder(nil).group('accounts.domain').select('accounts.domain, count(accounts.id) as accounts_from_domain').page(params[:page]).per(10) + @domains = current_account.followers.reorder('MIN(follows.id) DESC').group('accounts.domain').select('accounts.domain, count(accounts.id) as accounts_from_domain').page(params[:page]).per(10) end def update -- cgit