dossier: prepare validations to piece_justificative champs
We can't yet enable the validations, because of an issue that will (hopefully) be solved with Rails 6. See https://github.com/betagouv/demarches-simplifiees.fr/issues/4926
This commit is contained in:
parent
f3c210e875
commit
fe13043efd
4 changed files with 30 additions and 2 deletions
|
@ -1,7 +1,8 @@
|
|||
class Champs::PieceJustificativeChamp < Champ
|
||||
PIECE_JUSTIFICATIVE_FILE_MAX_SIZE = 200.megabytes
|
||||
MAX_SIZE = 200.megabytes
|
||||
|
||||
PIECE_JUSTIFICATIVE_FILE_ACCEPTED_FORMATS = [
|
||||
ACCEPTED_FORMATS = [
|
||||
"text/plain",
|
||||
"application/pdf",
|
||||
"application/msword",
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
|
@ -16,6 +17,13 @@ class Champs::PieceJustificativeChamp < Champ
|
|||
"image/jpeg"
|
||||
]
|
||||
|
||||
# TODO: once we're running on Rails 6, re-enable this validation.
|
||||
# See https://github.com/betagouv/demarches-simplifiees.fr/issues/4926
|
||||
#
|
||||
# validates :piece_justificative_file,
|
||||
# content_type: ACCEPTED_FORMATS,
|
||||
# size: { less_than: MAX_SIZE }
|
||||
|
||||
def main_value_name
|
||||
:piece_justificative_file
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue