refactor(dossier): rename check_mandatory_champs -> check_mandatory_and_visible_champs

This commit is contained in:
simon lehericey 2022-10-17 10:41:47 +02:00 committed by LeSim
parent 9bba2093be
commit fbf089d60e
3 changed files with 6 additions and 5 deletions

View file

@ -981,8 +981,9 @@ class Dossier < ApplicationRecord
champs.filter(&:titre_identite?).map(&:piece_justificative_file).each(&:purge_later)
end
def check_mandatory_champs
def check_mandatory_and_visible_champs
(champs + champs.filter(&:block?).filter(&:visible?).flat_map(&:champs))
.filter(&:visible?)
.filter(&:mandatory_blank?)
.map do |champ|
"Le champ #{champ.libelle.truncate(200)} doit être rempli."