igorkasyanchuk/active_storage_validations

[Validator] Add a media_type validator

Aperta

#277 aperta il 7 nov 2024

 (0 commenti) (0 reazioni) (0 assegnatari)Ruby (148 fork)github user discovery
enhancementgood first issue

Metriche repository

Star
 (1179 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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)

Guida contributor