diff --git a/app/models/dossier.rb b/app/models/dossier.rb index e9304b63e..5b32be941 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -932,7 +932,7 @@ class Dossier < ApplicationRecord end def remove_titres_identite! - champs_public.filter(&:titre_identite?).map(&:piece_justificative_file).each(&:purge_later) + champs.filter(&:titre_identite?).map(&:piece_justificative_file).each(&:purge_later) end def remove_piece_justificative_file_not_visible! @@ -1147,7 +1147,7 @@ class Dossier < ApplicationRecord end def has_annotations? - revision.revision_types_de_champ_private.present? + revision.types_de_champ_private.present? end def hide_info_with_accuse_lecture? diff --git a/app/models/procedure_revision_type_de_champ.rb b/app/models/procedure_revision_type_de_champ.rb index 503595143..b8e538c97 100644 --- a/app/models/procedure_revision_type_de_champ.rb +++ b/app/models/procedure_revision_type_de_champ.rb @@ -32,8 +32,8 @@ class ProcedureRevisionTypeDeChamp < ApplicationRecord end def siblings - if parent_id.present? - revision.revision_types_de_champ.where(parent_id: parent_id).ordered + if child? + revision.revision_types_de_champ.where(parent_id:).ordered elsif private? revision.revision_types_de_champ_private else diff --git a/app/views/instructeurs/dossiers/_instruction_button_motivation.html.haml b/app/views/instructeurs/dossiers/_instruction_button_motivation.html.haml index 76b4d576e..56c83c685 100644 --- a/app/views/instructeurs/dossiers/_instruction_button_motivation.html.haml +++ b/app/views/instructeurs/dossiers/_instruction_button_motivation.html.haml @@ -12,7 +12,7 @@ - if unspecified_attestation_champs.present? .warning Attention, les valeurs suivantes n’ont pas été renseignées mais sont nécessaires pour pouvoir envoyer une attestation valide : - - unspecified_annotations_privees, unspecified_champs = unspecified_attestation_champs.partition(&:private) + - unspecified_annotations_privees, unspecified_champs = unspecified_attestation_champs.partition(&:private?) - if unspecified_champs.present? %h4 Champs de la demande