From 57f49c819184d7ecb6d789889671d5d6c7b4167a Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 8 Jan 2024 06:09:50 -0500 Subject: [PATCH] Use Arel `nulls_first` method in ordering CustomEmojiFilter scope (#28614) --- app/models/custom_emoji_filter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/custom_emoji_filter.rb b/app/models/custom_emoji_filter.rb index ed7a8dda15..870cc71974 100644 --- a/app/models/custom_emoji_filter.rb +++ b/app/models/custom_emoji_filter.rb @@ -31,7 +31,7 @@ class CustomEmojiFilter def scope_for(key, value) case key.to_s when 'local' - CustomEmoji.local.left_joins(:category).reorder(Arel.sql('custom_emoji_categories.name ASC NULLS FIRST, custom_emojis.shortcode ASC')) + CustomEmoji.local.left_joins(:category).reorder(CustomEmojiCategory.arel_table[:name].asc.nulls_first).order(shortcode: :asc) when 'remote' CustomEmoji.remote when 'by_domain'