Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

igorkasyanchuk/active_storage_validations — Do it like => validates :photos, attached: true, content_type: ['image/png', 'image/jpg', 'image/jpe…

Description and use

active_storage_validations is a Ruby gem that adds convenient, declarative validation helpers to Rails’ Active Storage attachments. It lets you enforce rules such as presence, allowed content types, file size limits, quantity constraints, aspect ratios, and dimension ranges directly in your models (e.g., 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 } }). This makes ensuring uploaded media meets your specifications simple and consistent across the application.

Problem

igorkasyanchuk/active_storage_validations may be useful when its README and activity match a concrete workflow.

Outcome

Early or unclear: treat as research material until maintenance, releases, docs, and issue activity are verified.

Evidence

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 }

Source

  • Record date: 2026-09-13T14:18:56.645Z