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)

貢獻者指南