igorkasyanchuk/active_storage_validations

Validations not working on Ckeditor gem models?

クローズ

#145 opened on 2022/02/24

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)Ruby (148 件のフォーク)github user discovery
bughelp wanted

Repository metrics

Stars
 (1,179 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Hello! I am unsure if this should mentioned here or under the ckeditor gem...

I have noticed that adding validations for file content types and sizes for Ckeditor::Picture, Ckeditor::Asset, and Ckeditor::AttachmentFile models do not seem to work.

Adding: validates :storage_data, size: { less_than: 5.megabytes }, content_type: /\Aimage\/.*\z/ or validates :storage_data, size: { less_than: 5.megabytes }, content_type: ['image/png', 'image/jpg', 'image/jpeg'] in any of the above listed models do not restrict a large image or a pdf from being uploaded. The types seem to be registered with Marcel::EXTENSIONS

ckeditor gem (5.1.1) active_storage_validations gem (0.9.6)

コントリビューターガイド