models: ensure Champs::Pays#to_s is always a string

Before this, the result of `Champs::Pays#to_s` could be `nil`, which
would break various things (like the PDF rendering of these champs).
This commit is contained in:
Pierre de La Morinerie 2021-09-07 10:45:54 -05:00
parent 8adbebb525
commit 905fca0bd3

View file

@ -20,7 +20,7 @@
class Champs::PaysChamp < Champs::TextChamp
def localized_value
if external_id
I18nData.countries(I18n.locale)[external_id]
I18nData.countries(I18n.locale)[external_id].to_s
else
value.present? ? value.to_s : ''
end