about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-10-01 06:06:09 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-30 23:06:09 +0200
commitcdacac8c6cbd85ed6e8a1cac8ce6fa5994094c7c (patch)
treef4649683b67a6c245b73c0a47e5dba60ecf1c159 /app/controllers
parenteb605141ffb95290c5a537802ea418e6e45bf95f (diff)
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
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/settings/follower_domains_controller.rb2
1 files changed, 1 insertions, 1 deletions
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