Good point, after reading my question I have to admit, that was pretty weak.
Im noticing that the uploader doesn’t pull the most recent list of accepted datatypes from the DataType model. For example: in testing I added
application/msword as the only accepted FileType. Then when testing the upload form, the results were as expected. All files except .doc were rejected.
Then I added a few other options to the FileType model(
application/vnd.ms-excel). Then when I try to upload an .xls file I get the following error:
Attachments file type must be one of: application/msword
Here’s the output for FileType.all
created_at: Wed, 08 Jul 2020 20:19:53 UTC +00:00,
updated_at: Wed, 08 Jul 2020 20:19:53 UTC +00:00>,
created_at: Fri, 10 Jul 2020 16:58:00 UTC +00:00,
updated_at: Fri, 10 Jul 2020 16:58:00 UTC +00:00>,
created_at: Fri, 10 Jul 2020 16:58:07 UTC +00:00,
updated_at: Fri, 10 Jul 2020 16:58:07 UTC +00:00>]
It seems like the uploader is the wrong place to fetch a list of accepted mimetypes from the database. Is there somewhere I can place the validator which will pull an up to date list of accepted mimetypes from the database?