Merge pull request #3577 from betagouv/frederic/fix_champ_field_order

Force stable order on champ fields
This commit is contained in:
Frederic Merizen 2019-03-11 11:39:03 +01:00 committed by GitHub
commit 45994089ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,10 +50,12 @@ class ProcedurePresentation < ApplicationRecord
fields.concat procedure.types_de_champ
.where.not(type_champ: explanatory_types_de_champ)
.order(:id)
.map { |type_de_champ| field_hash(type_de_champ.libelle, 'type_de_champ', type_de_champ.id.to_s) }
fields.concat procedure.types_de_champ_private
.where.not(type_champ: explanatory_types_de_champ)
.order(:id)
.map { |type_de_champ| field_hash(type_de_champ.libelle, 'type_de_champ_private', type_de_champ.id.to_s) }
fields