Browse Source

Sort rent periods in organisation details page

pull/2680/head
Manny Dinssa 2 years ago
parent
commit
422576fcd6
  1. 4
      app/models/organisation.rb

4
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?

Loading…
Cancel
Save