extract libelle_id_procedures

This commit is contained in:
simon lehericey 2024-01-30 09:54:06 +01:00
parent 9ec59669c3
commit b7af591e8d
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5

View file

@ -13,11 +13,7 @@ module Administrateurs
def autorisations
@name = name
@libelle_id_procedures = current_administrateur
.procedures
.order(:libelle)
.pluck(:libelle, :id)
.map { |libelle, id| ["#{id} - #{libelle}", id] }
@libelle_id_procedures = libelle_id_procedures
end
def securite
@ -37,6 +33,7 @@ module Administrateurs
end
def edit
@libelle_id_procedures = libelle_id_procedures
end
def update
@ -74,6 +71,14 @@ module Administrateurs
EOF
end
def libelle_id_procedures
current_administrateur
.procedures
.order(:libelle)
.pluck(:libelle, :id)
.map { |libelle, id| ["#{id} - #{libelle}", id] }
end
def all_params
[:name, :access, :target, :targets, :networkFiltering, :networks, :lifetime, :customLifetime]
.index_with { |param| params[param] }