diff --git a/app/models/account_summary.rb b/app/models/account_summary.rb index 2a21d09a8..f05281636 100644 --- a/app/models/account_summary.rb +++ b/app/models/account_summary.rb @@ -15,7 +15,7 @@ class AccountSummary < ApplicationRecord has_many :follow_recommendation_suppressions, primary_key: :account_id, foreign_key: :account_id, inverse_of: false scope :safe, -> { where(sensitive: false) } - scope :localized, ->(locale) { where(language: locale) } + scope :localized, ->(locale) { order(Arel::Nodes::Case.new.when(arel_table[:language].eq(locale)).then(1).else(0).desc) } scope :filtered, -> { where.missing(:follow_recommendation_suppressions) } def self.refresh