[#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
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
value.present? ? [primary_value, secondary_value].compact.join(' / ') : ""
|
value.present? ? [primary_value, secondary_value].select(&:present?).join(' / ') : ""
|
||||||
end
|
end
|
||||||
|
|
||||||
def for_export
|
def for_export
|
||||||
|
|
|
@ -129,7 +129,7 @@ describe TagsSubstitutionConcern, type: :model do
|
||||||
c.primary_value = 'primo'
|
c.primary_value = 'primo'
|
||||||
c.save
|
c.save
|
||||||
end
|
end
|
||||||
it { is_expected.to eq('tout : primo / , primaire : primo, secondaire : ') }
|
it { is_expected.to eq('tout : primo, primaire : primo, secondaire : ') }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'and the champ has a primary and secondary value' do
|
context 'and the champ has a primary and secondary value' do
|
||||||
|
|
Loading…
Reference in a new issue