August 9

0 comments

Active Storage in Rails 5.2 DOES NOT SUPPORT VALIDATIONS

By Christopher G Mendla

August 9, 2018


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.

https://github.com/rails/rails/issues/31656

Christopher G Mendla

About the author

A web developer living in Southampton, PA

Self motivated critical thinker and problem solver providing technology consulting services.

Leave a Reply

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

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}