fix(type_de_champ): should use dossier revision instead of type_de_champ revision
This commit is contained in:
parent
eae58ae5b0
commit
08ed5e0d87
2 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,7 @@
|
|||
class Champs::HeaderSectionChamp < Champ
|
||||
def level
|
||||
if parent.present?
|
||||
header_section_level_value.to_i + parent.current_section_level
|
||||
header_section_level_value.to_i + parent.current_section_level(dossier.revision)
|
||||
elsif header_section_level_value
|
||||
header_section_level_value.to_i
|
||||
else
|
||||
|
|
|
@ -439,7 +439,7 @@ class TypeDeChamp < ApplicationRecord
|
|||
errs
|
||||
end
|
||||
|
||||
def current_section_level
|
||||
def current_section_level(revision)
|
||||
tdcs = private? ? revision.types_de_champ_private.to_a : revision.types_de_champ_public.to_a
|
||||
|
||||
previous_section_level(tdcs.take(tdcs.find_index(self)))
|
||||
|
|
Loading…
Reference in a new issue