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 }
Active Storage Validations is a Ruby gem for adding validation rules to files attached through Rails Active Storage. Rails developers use it to check whether uploaded images, videos, audio files, PDFs, and other attachments meet requirements such as type, size, dimensions, duration, or quantity.
Latest release 4.1.1 · 12 Sept 2026
2 files for Codex, OpenCode, Claude Code and Cursor: active_storage_validations AGENTS.md, commit — 4,710 tokens loaded in every session.
AGENTS.md A 4,710 tok .cursor/skills/commit/SKILL.md A 35 tok These files are igorkasyanchuk/active_storage_validations's own configuration — they tell Codex, OpenCode, Claude Code and Cursor how to work on this repository, so they are not mods to install elsewhere. Copy one as a starting point and replace the parts that are about this project.