[#3356] Improve formatting for menus that only have a primary value
This commit is contained in:
parent
a3d7c8de55
commit
a255e61556
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue