You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When backed by a string the incorrect_length_validation raises:
the schema limits attachments.attachment_type to 255 characters but there's no length validator on Attachment.attachment_type - remove the database limit or add the validator
The validates_inclusion_of used under the hood by enum validation only accepts the options for :allow_nil, :allow_blank` and doesn't allow passing additional length validations.
I'd like a way to silence this without having to configure an ignore for each one. Or if possible check the enum options to ensure none of them have a length greater then the database col max when validate: true or validate: { allow_nil: true }
The text was updated successfully, but these errors were encountered:
Rails 7.1+ introduced validation on enums in rails/rails#49100.
When backed by a string the
incorrect_length_validation
raises:The
validates_inclusion_of
used under the hood by enum validation only accepts the options for:allow_nil
, :allow_blank` and doesn't allow passing additional length validations.I'd like a way to silence this without having to configure an ignore for each one. Or if possible check the enum options to ensure none of them have a length greater then the database col max when
validate: true
orvalidate: { allow_nil: true }
The text was updated successfully, but these errors were encountered: