From 4be319804bb16bc801d3a0417031f0dd45bba97c Mon Sep 17 00:00:00 2001 From: Antoine Girard Date: Wed, 30 Oct 2024 18:49:14 +0100 Subject: [PATCH] Use ordered_by_name --- app/controllers/static_pages_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index d7332b7838..721296b478 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -10,11 +10,11 @@ def contact territories_with_phone_number = Territory.where.not(phone_number_formatted: nil) territories_group_by_department = territories_with_phone_number .where(departement_number: Territory::DEPARTEMENTS_NAMES.keys) - .order(:departement_number, :name).group_by(&:departement_number) + .order(:departement_number).ordered_by_name.group_by(&:departement_number) territories_without_department = territories_with_phone_number .where.not(departement_number: Territory::DEPARTEMENTS_NAMES.keys) - .order(:name) + .ordered_by_name render locals: { territories_group_by_department: territories_group_by_department,