Use Arel `nulls_first` method in ordering CustomEmojiFilter scope (#28614)

pull/28627/head
Matt Jankowski 2024-01-08 06:09:50 -05:00 committed by GitHub
parent 832b92ac3e
commit 57f49c8191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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'