about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-12-08 01:32:26 +0100
committerGitHub <noreply@github.com>2018-12-08 01:32:26 +0100
commit6b78e5b5ab813625152149b7e215d0568a595cdc (patch)
treee3bccf93cf3bfda06b35f1e4069cf7ef3a8454b1 /app/models/account.rb
parent4638b1682247df52ab5b22d06cd2a3df3277b2f9 (diff)
Cache hashtag sample accounts, and exclude ineligible ones (#9465)
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index c22836afe..9767e3767 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -94,7 +94,7 @@ class Account < ApplicationRecord
   scope :discoverable, -> { where(silenced: false).where(discoverable: true).joins(:account_stat).where(AccountStat.arel_table[:followers_count].gteq(MIN_FOLLOWERS_DISCOVERY)) }
   scope :tagged_with, ->(tag) { joins(:accounts_tags).where(accounts_tags: { tag_id: tag }) }
   scope :popular, -> { order('account_stats.followers_count desc') }
-  scope :by_recent_status, -> { order('(case when account_stats.last_status_at is null then 1 else 0 end) asc, account_stats.last_status_at desc') }
+  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')) }
 
   delegate :email,
            :unconfirmed_email,