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...
Hi! I am having a problem with the dimension validator where [this line](https://github.com/igorkasyanchuk/active_storage_validations/blob/47f676ff16eded49226c5df9a02e6e312a5cbb25/lib/active_storage_validations/metadata.rb#L24) causes the exception `NoMethodError (undefined method `id' for nil:NilClass)`. Any idea of how to fix? Thanks! ps....
This Gem is great. i'm using it for a front end form which is perfect. I'm also using it for the Admin part of my App using activeadmin gem. I...
Hey, thanks for your work on the gem! Consider the following example code: ``` # In model.rb has_one_attached :image accepts_nested_attributes_for :image_attachment, allow_destroy: true validates :image, presence: true ``` If the...
Hi :) great work on the gem! I have a validation that I only want to run on update. The validation does run on update as I expect, however the...
Using: ```ruby validates :attachments, size: { less_than: 200.kilobytes } ``` The message I get is > Attachments size 1.5 MB is not between required range - This is broken English...
I ran into an issue when using active_storage_validations with Trestle (https://github.com/TrestleAdmin/trestle/trestle-active_storage) and with trestle-active_storage (https://github.com/richardvenneman/trestle-active_storage, wrote about the issue here: https://github.com/richardvenneman/trestle-active_storage/issues/23) and I'm not sure which of the gems possibly...
I have the following model: ```ruby class Payment < ApplicationRecord validates :voucher, attached: true, if: :paid? end ``` And the following test: ```ruby context 'when is paid' do subject {...
``` en: errors: messages: content_type_invalid: "has an invalid content type" ... ``` does not work. but if I put messages under activerecord errors, it works.
When using direct uploads, ActiveStorage will delay identifying the file into a background job, spawned only after the file has been attached. Currently, the initial blob's `content_type` is determined solely...