Use in_order_of with filter: false in AccountSummary.localized (#33446)
This commit is contained in:
@@ -17,6 +17,6 @@ class AccountSummary < ApplicationRecord
|
||||
has_many :follow_recommendation_suppressions, primary_key: :account_id, foreign_key: :account_id, inverse_of: false, dependent: nil
|
||||
|
||||
scope :safe, -> { where(sensitive: false) }
|
||||
scope :localized, ->(locale) { order(Arel::Nodes::Case.new.when(arel_table[:language].eq(locale)).then(1).else(0).desc) }
|
||||
scope :localized, ->(locale) { in_order_of(:language, [locale], filter: false) }
|
||||
scope :filtered, -> { where.missing(:follow_recommendation_suppressions) }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user