Skip to content

Validations not working on Ckeditor gem models? #145

Open
@nkirby-nxt

Description

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions