Order emoji categories (in admin interface) by name (#33630)

This commit is contained in:
Jonathan de Jong authored and GitHub committed 2025-01-22 08:31:51 +00:00
1 parent 3dcf5e12b1
commit e380e803a8
2 files changed
+3 -1

No files matched your search

+2
View File
@@ -14,4 +14,6 @@ class CustomEmojiCategory < ApplicationRecord
has_many :emojis, class_name: 'CustomEmoji', foreign_key: 'category_id', inverse_of: :category, dependent: nil
validates :name, presence: true, uniqueness: true
scope :alphabetic, -> { order(name: :asc) }
end
@@ -72,7 +72,7 @@
.input.select.optional
.label_input
= f.select :category_id,
options_from_collection_for_select(CustomEmojiCategory.all, 'id', 'name'),
options_from_collection_for_select(CustomEmojiCategory.alphabetic.all, 'id', 'name'),
'aria-label': t('admin.custom_emojis.assign_category'),
class: 'select optional',
prompt: t('admin.custom_emojis.assign_category')