2021-12-14 13:54:26 +01:00
|
|
|
module ZoneHelper
|
2022-08-12 14:46:54 +02:00
|
|
|
def grouped_options_for_zone(date)
|
2021-12-14 13:54:26 +01:00
|
|
|
collectivite = Zone.find_by(acronym: "COLLECTIVITE")
|
|
|
|
{
|
2022-08-12 14:46:54 +02:00
|
|
|
"--" => [
|
|
|
|
[I18n.t('i_dont_know', scope: 'utils'), nil],
|
|
|
|
[collectivite.label, collectivite.id]
|
|
|
|
],
|
|
|
|
I18n.t('ministeres', scope: 'zones') => (Zone.available_at(date) - [collectivite]).map { |m| [m.label_at(date), m.id] }
|
2021-12-14 13:54:26 +01:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|