cleanup: more concistent methods usage

This commit is contained in:
Paul Chavard 2024-08-22 17:38:04 +02:00
parent 32bf3ec9db
commit 3ef6f450da
No known key found for this signature in database
3 changed files with 5 additions and 5 deletions

View file

@ -932,7 +932,7 @@ class Dossier < ApplicationRecord
end end
def remove_titres_identite! 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 end
def remove_piece_justificative_file_not_visible! def remove_piece_justificative_file_not_visible!
@ -1147,7 +1147,7 @@ class Dossier < ApplicationRecord
end end
def has_annotations? def has_annotations?
revision.revision_types_de_champ_private.present? revision.types_de_champ_private.present?
end end
def hide_info_with_accuse_lecture? def hide_info_with_accuse_lecture?

View file

@ -32,8 +32,8 @@ class ProcedureRevisionTypeDeChamp < ApplicationRecord
end end
def siblings def siblings
if parent_id.present? if child?
revision.revision_types_de_champ.where(parent_id: parent_id).ordered revision.revision_types_de_champ.where(parent_id:).ordered
elsif private? elsif private?
revision.revision_types_de_champ_private revision.revision_types_de_champ_private
else else

View file

@ -12,7 +12,7 @@
- if unspecified_attestation_champs.present? - if unspecified_attestation_champs.present?
.warning .warning
Attention, les valeurs suivantes nont pas été renseignées mais sont nécessaires pour pouvoir envoyer une attestation valide : Attention, les valeurs suivantes nont 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? - if unspecified_champs.present?
%h4 Champs de la demande %h4 Champs de la demande