Active Storage in Rails 5.2 DOES NOT SUPPORT VALIDATIONS

Last Updated on January 19, 2020 by Christopher G Mendla

You have to be kidding me.. I just found out that Active Storage in Rails DOES NOT SUPPORT VALIDATIONS.

Active Storage is new to Rails 5.2. It is designed to replace tools such as CarrierWave and Paperclip that allow users to upload attachments

BUT it does not support validations.

In other words, there is no built in means of limiting file size or file extension/type.  If you want to validate the data, you need to build your own solution. If you don’t users can upload huge files or possibly malicious files.

This issue in the Rails Repo has been locked.  It is a discussion of this shortcoming of Active Storage.

Leave a Reply

Your email address will not be published. Required fields are marked *