champ: fix siblings for repetition champs

Fix a crash when requesting the `section_index` of a section header
in a repetition champ.
This commit is contained in:
Pierre de La Morinerie 2020-02-17 17:11:17 +01:00
parent 459730e1ff
commit d6a9318d05
3 changed files with 34 additions and 9 deletions

View file

@ -26,7 +26,9 @@ class Champ < ApplicationRecord
end
def siblings
if public?
if parent
parent&.champs
elsif public?
dossier&.champs
else
dossier&.champs_private