refactor(dossier): rename check_mandatory_champs -> check_mandatory_and_visible_champs
This commit is contained in:
parent
9bba2093be
commit
fbf089d60e
3 changed files with 6 additions and 5 deletions
|
@ -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."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue