[#3424] Improve formatting of addresses with missing components
This commit is contained in:
parent
8750d0e410
commit
41ab7246cf
2 changed files with 11 additions and 1 deletions
|
@ -45,7 +45,11 @@ class Etablissement < ApplicationRecord
|
|||
|
||||
def inline_adresse
|
||||
# squeeze needed because of space in excess in the data
|
||||
"#{numero_voie} #{type_voie} #{nom_voie}, #{complement_adresse}, #{code_postal} #{localite}".squeeze(' ')
|
||||
[
|
||||
"#{numero_voie} #{type_voie} #{nom_voie}",
|
||||
complement_adresse,
|
||||
"#{code_postal} #{localite}"
|
||||
].map { |s| s.squeeze(' ') }.reject(&:blank?).join(', ')
|
||||
end
|
||||
|
||||
def verify
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue