active_storage_validations
active_storage_validations copied to clipboard
Validate total size of attachments in case of has_many relationship
This is a great gem, thanks a lot.
As far as I understand, it's not possible to validate the total file size (summation of each file size) in case we have a has_many
relationship. For example, I have the following contraint:
- upload some documents summing up to 10MB in size, each document with max 1MB each.
Currently I'm validating manually in the Model, but it'd be useful to have this in the gem as well.
I can try to implement it with some guidance.
Hi @a-moreira, Thanks for raising this issue. It seems like a nice addition to the gem. I can guide you on how to implement it, or I can do it myself if you are too busy right now. Let me know!
hey @Mth0158, thanks for the reply. I'm busy right now so feel free to implement it :-)
Hi! Any updates on this feature? @Mth0158
Hi, @mattiasgullstrand I am busy these days, maybe I will find some time to implement it, but I can't say when... It would be a nice addition to the gem though, feel free to assign it to yourself if you want to work on it :)
Thanks @Mth0158. I see, and I agree, would be a nice addition! But not sure that I will have time anytime soon either