]> cat aescling's git repositories - mastodon.git/commitdiff
Fix regression in #9539 (#9541)
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 17 Dec 2018 03:32:36 +0000 (04:32 +0100)
committerGitHub <noreply@github.com>
Mon, 17 Dec 2018 03:32:36 +0000 (04:32 +0100)
app/models/account.rb

index a47741611dd84fc306c2c52b935c2fc8fe3e035c..5a7a9c580a04c6c6e27f5aa5cbed51ad58843509 100644 (file)
@@ -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,