-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to validate already saved attachment (needs remote download) #193
Comments
@igorkasyanchuk any thoughts on this one? |
yeah, perhaps, but can create a bigger issue. If a file is stored in S3 for example, it means that to validate it we need to download it back and measure the dimensions. Probably we can mark this issue as "known issue". It can be handled somehow inside app logic. wdyt? |
@igorkasyanchuk I agree with @Mth0158 .valid? should raise an error in creation or update. I understand your point of view that it can be a issue in some case so maybe we can add an option to choose if we want to validate attachment only on creation ? |
Hi @ckornaros, |
Hi @ckornaros, @gaelchriste, Long time no see. This issue should be solved with the v2 coming this month! ✅ FYI, starting from v2 we will store the file metadata ( user.avatar.attach(...) # image with wrong dimensions
user.valid? # => false
user.save(validate: false)
user.valid? # => true It should return false for the last line since the file metadata saved in the first |
Hello, in
DimensionValidator
is there a reason to validate image dimensions only when uploading attachment and not all the time ?active_storage_validations/lib/active_storage_validations/dimension_validator.rb
Lines 41 to 53 in b970f95
Example:
Thank you!
The text was updated successfully, but these errors were encountered: