# igorkasyanchuk/active_storage_validations

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/igorkasyanchuk-active-storage-validations).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

1,180 stars · 149 forks · Ruby · MIT

## Links

- GitHub: https://github.com/igorkasyanchuk/active_storage_validations
- Homepage: https://www.railsjazz.com/
- awesome-repositories: https://awesome-repositories.com/repository/igorkasyanchuk-active-storage-validations.md

## Topics

`active-storage` `activestorage` `rails` `validations`

## Description

Active Storage Validations is a library for Ruby on Rails that provides model-level validation helpers for file attachments. It integrates directly into the standard validation lifecycle to ensure that uploaded content conforms to defined business requirements before it is persisted to storage.

The framework enforces constraints on file size, content type, dimensions, and the number of attachments. It includes security mechanisms to detect and block content-type spoofing by inspecting the binary signature of files to verify that their actual format matches the declared extension.

Beyond basic validation, the library supports media asset quality control by enforcing specific aspect ratios and dimensions. It also provides testing matchers to verify that these constraints are correctly configured within development workflows.

## Tags

### Web Development

- [File Validation Plugins](https://awesome-repositories.com/f/web-development/ruby-on-rails-integrations/file-validation-plugins.md) — Adds declarative validation rules to file attachments within web application models.
- [Ruby on Rails Integrations](https://awesome-repositories.com/f/web-development/ruby-on-rails-integrations.md) — Provides a collection of validation helpers for file attachments including size, type, and dimension constraints.
- [Security Validation Frameworks](https://awesome-repositories.com/f/web-development/ruby-on-rails-integrations/security-validation-frameworks.md) — Prevents file spoofing by inspecting the actual content of uploaded files against declared MIME types.
- [Web Security Hardening](https://awesome-repositories.com/f/web-development/web-security-hardening.md) — Prevents malicious file uploads by verifying the actual content type and structure of user-provided files.

### Part of an Awesome List

- [File Upload Constraint Validation](https://awesome-repositories.com/f/awesome-lists/devtools/file-upload/upload-constraints/file-upload-constraint-validation.md) — Enforces configurable limits on file attachments to ensure database records remain valid.

### Data & Databases

- [Binary Signature Verification](https://awesome-repositories.com/f/data-databases/content-type-detection/binary-signature-verification.md) — Analyzes binary signatures to verify that the actual file format matches the declared extension, preventing spoofing.
- [Attachment Validation Validators](https://awesome-repositories.com/f/data-databases/storage-schema-validations/attachment-validation-validators.md) — Provides model-level validators to ensure uploaded files meet business requirements before storage.
- [Model](https://awesome-repositories.com/f/data-databases/validation-integrations/model.md) — Integrates validation logic directly into the model lifecycle to ensure data integrity before persistence.

### Graphics & Multimedia

- [Media File Validations](https://awesome-repositories.com/f/graphics-multimedia/media-file-validations.md) — Provides comprehensive file validation to enforce limits on file size, content type, and dimensions. ([source](https://github.com/igorkasyanchuk/active_storage_validations#readme))
- [Media Quality Constraints](https://awesome-repositories.com/f/graphics-multimedia/media-quality-upgrading/media-quality-constraints.md) — Enforces strict constraints on image dimensions and aspect ratios to maintain consistent visual standards.

### Security & Cryptography

- [File Upload Security](https://awesome-repositories.com/f/security-cryptography/file-upload-security.md) — Inspects the actual content of uploaded files to prevent security risks caused by misrepresentation. ([source](https://github.com/igorkasyanchuk/active_storage_validations#readme))

### Development Tools & Productivity

- [Metadata Constraint Rulesets](https://awesome-repositories.com/f/development-tools-productivity/collaborative-development-environments/version-consistency/version-constraints/configuration-driven-constraints/metadata-constraint-rulesets.md) — Evaluates file attributes against predefined rulesets to ensure compliance with size, aspect ratio, and quantity requirements.
- [Model Constraint Test Matchers](https://awesome-repositories.com/f/development-tools-productivity/validation-logic/logic-validation-frameworks/model-logic-testing/model-constraint-test-matchers.md) — Provides CLI tools and matchers to verify that file requirements are correctly applied to data models. ([source](https://github.com/igorkasyanchuk/active_storage_validations#readme))

### Software Engineering & Architecture

- [Storage Lifecycle Hooks](https://awesome-repositories.com/f/software-engineering-architecture/event-driven-callbacks/lifecycle-callbacks/storage-lifecycle-hooks.md) — Hooks into file storage operations to intercept and validate data before it reaches the storage backend.
