about summary refs log tree commit diff
path: root/app/models/account.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-12-18 16:55:15 +0100
committerThibaut Girka <thib@sitedethib.com>2018-12-18 16:55:15 +0100
commit034ffc079e40e0c723173b5998242803cc28dc50 (patch)
treefee1b208be2068cf372ab23f268a66ca51cc2dc3 /app/models/account.rb
parent36d27e289177fdec5332539c94b8192022a412f2 (diff)
parent5bf100f87be571e86305f3ab244183fc46f1ede2 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/controllers/admin/base_controller.rb
  Some refactoring made upstream, no real conflict.
- app/javascript/mastodon/features/compose/components/compose_form.js
  Updated using upstream's code but using maxChars instead of the
  hardcoded length of 500 characters per toot.
- app/javascript/styles/mastodon/components.scss
  Upstream redesigned the onboarding modal. Not sure why we had a
  conflict there.
Diffstat (limited to 'app/models/account.rb')
-rw-r--r--app/models/account.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 71264bc9f..60ad0788e 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -95,10 +95,10 @@ 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')) }
+  scope :popular, -> { order('account_stats.followers_count desc') }
 
   delegate :email,
            :unconfirmed_email,