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-17 03:14:28 +0100
committerGitHub <noreply@github.com>2018-12-17 03:14:28 +0100
commit087e11897137dc1f2811c21c3ccc6cec3ccdedb3 (patch)
treec690ef737c21b6c2f910c0363ec22eef8192bc70 /app/models/account.rb
parent628da11e38b0580a074268f32d09791ed6278def (diff)
Remove "most popular" tab from profile directory, add responsive design (#9539)
* Remove "most popular" tab from profile directory, add responsive design

* Remove unused translations
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 9767e3767..a47741611 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -91,9 +91,8 @@ class Account < ApplicationRecord
   scope :matches_display_name, ->(value) { where(arel_table[:display_name].matches("#{value}%")) }
   scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) }
   scope :searchable, -> { where(suspended: false).where(moved_to_account_id: nil) }
-  scope :discoverable, -> { where(silenced: false).where(discoverable: true).joins(:account_stat).where(AccountStat.arel_table[:followers_count].gteq(MIN_FOLLOWERS_DISCOVERY)) }
+  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 :popular, -> { order('account_stats.followers_count 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,