Skip to content

Commit

Permalink
Use ordered_by_name
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineGirard committed Oct 30, 2024
1 parent 2da0352 commit 561b5e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/static_pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 561b5e9

Please sign in to comment.