feat(commune): display departement information on commune champ
This commit is contained in:
parent
ed2cbdc966
commit
fcbe364ac8
3 changed files with 32 additions and 4 deletions
|
@ -25,4 +25,25 @@ class Champs::CommuneChamp < Champs::TextChamp
|
|||
def for_export
|
||||
[value, external_id]
|
||||
end
|
||||
|
||||
def name_departement
|
||||
#FIXME we originaly saved already formatted departement with the code in the name
|
||||
departement&.gsub(/^(.[0-9])\s-\s/, '')
|
||||
end
|
||||
|
||||
def departement_code_and_name
|
||||
"#{code_departement} - #{name_departement}"
|
||||
end
|
||||
|
||||
def departement?
|
||||
departement.present?
|
||||
end
|
||||
|
||||
def code?
|
||||
code.present?
|
||||
end
|
||||
|
||||
def code
|
||||
external_id
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue