Prevent crash in preview where there is no siblings
This commit is contained in:
parent
f9c9a7c115
commit
5e5122a436
2 changed files with 2 additions and 2 deletions
|
@ -88,7 +88,7 @@ class Champ < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def sections
|
def sections
|
||||||
siblings.filter(&:header_section?)
|
siblings&.filter(&:header_section?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def mandatory_and_blank?
|
def mandatory_and_blank?
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Champs::HeaderSectionChamp < Champ
|
||||||
end
|
end
|
||||||
|
|
||||||
def libelle_with_section_index
|
def libelle_with_section_index
|
||||||
if sections.none?(&:libelle_with_section_index?)
|
if sections&.none?(&:libelle_with_section_index?)
|
||||||
"#{section_index}. #{libelle}"
|
"#{section_index}. #{libelle}"
|
||||||
else
|
else
|
||||||
libelle
|
libelle
|
||||||
|
|
Loading…
Add table
Reference in a new issue