active_storage_validations
active_storage_validations copied to clipboard
Do it like => validates :photos, attached: true, content_type: ['image/png', 'image/jpg', 'image/jpeg'], size: { less_than: 500.kilobytes }, limit: { min: 1, max: 3 }, aspect_ratio: :landscape, dimens...
I get a Unknown validator: 'ContentTypeValidator' error on rails 6 when I try to validate my pdf files which are attached as a has_many _attached attachment. `validates :files, content_type: {in:...
Hello! I am unsure if this should mentioned here or under the ckeditor gem... I have noticed that adding validations for file content types and sizes for `Ckeditor::Picture`, `Ckeditor::Asset`, and...
Thanks for your gem, but you'd probably should know that after you added Marcel gem, it slowed specs a lot. We use validations only in 2 places and every validation...
Hello, tell me how you can check the file not only by extension but also by content, because at the moment, if, for example, change the file extension json to...
Rails version: 6.0.2.1 Gem version: 0.8.6 Validation: `validates :bill_kit, content_type: { in: ['application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'], message: 'is not a PDF or Word Document' }` If you upload a file other...
The model: ``` class ContentImage < ApplicationRecord has_one_attached :image validates :image, attached: true, content_type: [:png, :jpg, :jpeg, :gif], size: { less_than: 20.megabytes }, dimension: { width: { min: 640 }...
Hi there! Sometimes it is necessary to have dynamic values for validations. I have seen in some other validator gems also procs can be passed instead of integers. These are...
The dummy app's `Project` class makes use of the `LimitValidator` by specifying the minimum and maximum count of attached documents: ```Ruby class Project < ApplicationRecord … validates :documents, limit: {...
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...
**TL;DR** There is no way to detect broken image files. So exceptions are thrown later when ActiveStorage tries to render _variants_. I originally submitted this issue to https://github.com/rails/rails/issues/40493 but was...