-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Using File Validators file_content_type and file_size with Active Storage throw a Module::DelegationError error (content_type delegated to attachment, but attachment is nil and size delegated to attachment, but attachment is nil), when a form for a Model thats being validated gets submitted without attaching a file.
The following workaround works for now:
validates :image, file_content_type: { allow: ['image/jpeg', 'image/png', 'image/gif'] }, if: -> { image.attached? }This might fit into the README, should I open a PR?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels