about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-12-17 04:32:36 +0100
committerGitHub <noreply@github.com>2018-12-17 04:32:36 +0100
commitadaf249700a5384b817de12bc43ca67fcdc6f257 (patch)
treef9f445c11d5389146c3bc6e9e1f87c80f010820c /app/models
parent087e11897137dc1f2811c21c3ccc6cec3ccdedb3 (diff)
Fix regression in #9539 (#9541)
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index a47741611..5a7a9c580 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -94,6 +94,7 @@ class Account < ApplicationRecord
   scope :discoverable, -> { searchable.where(silenced: false).where(discoverable: true).joins(:account_stat).where(AccountStat.arel_table[:followers_count].gteq(MIN_FOLLOWERS_DISCOVERY)).by_recent_status }
   scope :tagged_with, ->(tag) { joins(:accounts_tags).where(accounts_tags: { tag_id: tag }) }
   scope :by_recent_status, -> { order(Arel.sql('(case when account_stats.last_status_at is null then 1 else 0 end) asc, account_stats.last_status_at desc')) }
+  scope :popular, -> { order('account_stats.followers_count desc') }
 
   delegate :email,
            :unconfirmed_email,