fix(champ): use safe_join in champ helpers

fix #7411
This commit is contained in:
Paul Chavard 2022-07-13 11:18:05 +02:00 committed by Paul Chavard
parent 5abc17fe74
commit 0578f4f305

View file

@ -42,17 +42,11 @@ module ChampHelper
def geo_area_label(geo_area)
case geo_area.source
when GeoArea.sources.fetch(:cadastre)
capture do
concat "Parcelle n° #{geo_area.numero} - Feuille #{geo_area.prefixe} #{geo_area.section} - #{geo_area.surface.round} m"
concat tag.sup("2")
end
safe_join ["Parcelle n° #{geo_area.numero} - Feuille #{geo_area.prefixe} #{geo_area.section} - #{geo_area.surface.round} m", tag.sup("2")]
when GeoArea.sources.fetch(:selection_utilisateur)
if geo_area.polygon?
if geo_area.area.present?
capture do
concat "Une aire de surface #{geo_area.area} m"
concat tag.sup("2")
end
safe_join ["Une aire de surface #{geo_area.area} m", tag.sup("2")]
else
"Une aire de surface inconnue"
end