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 31, 2024
1 parent ecb252a commit 4be3198
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 4be3198

Please sign in to comment.