igorkasyanchuk/active_storage_validations

[Validator] Add a media_type validator

开放

#277 创建于 2024年11月7日

 (0 条评论) (0 个反应) (0 位负责人)Ruby (148 个派生)github user discovery
enhancementgood first issue

仓库指标

星标
 (1,179 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

We could create a new validator called media_type whose purpose would be to validate the media type (ie the first part of the content_type, application, image, video and other). It could make things easier to write, rather than a content_type: /\Aimage\/.*\z/.

FYI

@mediatype, @subtype = content_type.split('/', 2)

贡献者指南