added before_save to PieceJustificativeChamp in order to set skip_pj_validation

This commit is contained in:
clemkeirua 2020-07-09 11:45:20 +02:00 committed by Keirua (Rebase PR Action)
parent c93d17bcaa
commit 299c86141c
2 changed files with 19 additions and 0 deletions

View file

@ -24,6 +24,8 @@ class Champs::PieceJustificativeChamp < Champ
# content_type: ACCEPTED_FORMATS,
# size: { less_than: MAX_SIZE }
before_save :update_skip_pj_validation
def main_value_name
:piece_justificative_file
end
@ -45,4 +47,8 @@ class Champs::PieceJustificativeChamp < Champ
piece_justificative_file.service_url
end
end
def update_skip_pj_validation
type_de_champ.update(options: type_de_champ.options&.merge({ :skip_pj_validation => true }) || { :skip_pj_validation => true })
end
end