[#3356] Improve formatting for menus that only have a primary value

This commit is contained in:
Frederic Merizen 2019-02-05 16:41:21 +01:00 committed by simon lehericey
parent a3d7c8de55
commit a255e61556
2 changed files with 2 additions and 2 deletions

View file

@ -30,7 +30,7 @@ class Champs::LinkedDropDownListChamp < Champ
end
def to_s
value.present? ? [primary_value, secondary_value].compact.join(' / ') : ""
value.present? ? [primary_value, secondary_value].select(&:present?).join(' / ') : ""
end
def for_export

View file

@ -129,7 +129,7 @@ describe TagsSubstitutionConcern, type: :model do
c.primary_value = 'primo'
c.save
end
it { is_expected.to eq('tout : primo / , primaire : primo, secondaire : ') }
it { is_expected.to eq('tout : primo, primaire : primo, secondaire : ') }
end
context 'and the champ has a primary and secondary value' do