Merge pull request #7568 from tchak/fix-issue-7411

fix(champ): use safe_join in champ helpers
This commit is contained in:
Paul Chavard 2022-07-18 16:40:26 +02:00 committed by GitHub
commit 795570b039
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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