No content_type validation on update (case of pdf files)
EricMbouwe opened this issue · 0 comments
EricMbouwe commented
I have this line in my Document model (in a rails 6 app)
validates :pdfs, attached: false, content_type: { in: 'application/pdf', message: 'Only PDF files !' }
When a user tries to update a Document with an invalid file (not pdf), the validation does not triggers and the update
action runs, which results in my case a 500 server response.
Here is a case where I have added two invalid files and tried to update the document.
Let's look at what is happening.
Thanks.