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:
parent
459730e1ff
commit
d6a9318d05
3 changed files with 34 additions and 9 deletions
|
@ -26,7 +26,9 @@ class Champ < ApplicationRecord
|
|||
end
|
||||
|
||||
def siblings
|
||||
if public?
|
||||
if parent
|
||||
parent&.champs
|
||||
elsif public?
|
||||
dossier&.champs
|
||||
else
|
||||
dossier&.champs_private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue