diff --git a/app/models/organisation.rb b/app/models/organisation.rb index e769f7b3d..bee597b11 100644 --- a/app/models/organisation.rb +++ b/app/models/organisation.rb @@ -115,7 +115,9 @@ class Organisation < ApplicationRecord mappings = RentPeriod.rent_period_mappings return %w[All] if (mappings.keys.map(&:to_i) - rent_period_ids).empty? - rent_period_ids.map { |id| mappings.dig(id.to_s, "value") }.compact + rent_period_ids.map { |id| mappings.dig(id.to_s, "value") }.compact.sort_by do |label| + mappings.keys.index { |key| mappings[key]["value"] == label } + end end def data_protection_confirmed?