[#2180] Do not double-expose migrated type PJ as type champ PJ

This commit is contained in:
Frederic Merizen 2019-01-10 18:50:12 +01:00
parent 63519f04c8
commit d01270eff2
2 changed files with 5 additions and 1 deletions

View file

@ -26,7 +26,7 @@ class DossierSerializer < ActiveModel::Serializer
has_many :champs, serializer: ChampSerializer
def champs
champs = object.champs.to_a
champs = object.champs.reject { |c| c.type_de_champ.old_pj.present? }
if object.expose_legacy_carto_api?
champ_carte = champs.find do |champ|