FIX: Make user themes sort order case insensitive (#15193)

That's the order they appear in a dropdown in user preferences.
This commit is contained in:
Jarek Radosz 2021-12-06 01:55:34 +01:00 committed by GitHub
parent 3b13f1146b
commit 4bb91754ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,7 @@ class SiteSerializer < ApplicationSerializer
cache_fragment("user_themes") do
Theme.where('id = :default OR user_selectable',
default: SiteSetting.default_theme_id)
.order(:name)
.order("lower(name)")
.pluck(:id, :name, :color_scheme_id)
.map { |id, n, cs| { theme_id: id, name: n, default: id == SiteSetting.default_theme_id, color_scheme_id: cs } }
.as_json