active_storage_validations
https://github.com/igorkasyanchuk/active_storage_validations
Ruby
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, dimension: { width: { in: 800..1600 }
Triage Issues!
When you volunteer to triage issues, you'll receive an email each day with a link to an open issue that needs help in this project. You'll also receive instructions on how to triage issues.
Triage Docs!
Receive a documented method or class from your favorite GitHub repos in your inbox every day. If you're really pro, receive undocumented methods or classes and supercharge your commit history.
1 Subscribers
Add a CodeTriage badge to active_storage_validations
Help out
- Issues
- Replace content_type `spoofing_protection` option by `deep_validation` (BREAKING)
- Add new handled content_types for processable_file validator (CSV, XML, JSON, txt, md, epub, open office, zip, ...) (POTENTIALLY BREAKING)
- Better handling of opened/streamed files with hard size threshold (BREAKING)
- Remove Rails 6.1.4 support
- Add `antivirus` validator
- Do not run heavy validators if `size` validator failed (BREAKING)
- Add timeouts limit for heavy validators (BREAKING)
- Absence of filename in error details, starting from v2 (regression)
- [8.1] Add `expect_on` validation option to matchers
- Where does it load the whole file?
- Docs
- Subscribe to help with docs for this repo and come back later