From 4add3859fdefae013173412d7efd77de1e4443a2 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Tue, 15 Jul 2025 13:51:09 +0100 Subject: [PATCH] Make online store templates ordering case-insensitive --- lib/music_library/online_store_templates.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/music_library/online_store_templates.ex b/lib/music_library/online_store_templates.ex index 8df38b96..d7509f2c 100644 --- a/lib/music_library/online_store_templates.ex +++ b/lib/music_library/online_store_templates.ex @@ -13,7 +13,7 @@ defmodule MusicLibrary.OnlineStoreTemplates do def list_enabled_templates do OnlineStoreTemplate |> where([t], t.enabled == true) - |> order_by([t], asc: t.name) + |> order_by([t], fragment("? COLLATE NOCASE ASC", t.name)) |> Repo.all() end @@ -22,7 +22,7 @@ defmodule MusicLibrary.OnlineStoreTemplates do """ def list_templates do OnlineStoreTemplate - |> order_by([t], asc: t.name) + |> order_by([t], fragment("? COLLATE NOCASE ASC", t.name)) |> Repo.all() end