Replies: 1 comment 6 replies
-
Thanks for the report. This is a bug. We shouldn't set a min_value/max_value for enum columns. The reason you have this issue is your column name starts with |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @jeremyevans, I'm updating my Sequel version from 5.61 to 5.67, and I ran into this error when creating a new model object:
This looks like it's being caused by the min/max validations helpers added in 5.62.0.
After digging into the error, I realized that my table has an enum column, and the auto-validator is confusing it for an integer column. It looks like the validation checking code picks up enum columns by accident?
This is what my enum column looks like in the
db_schema
object:And the code used to identify min/max value columns scans for the
:min_value
and:max_value
fields, but doesn't filter out enum types: https://github.com/jeremyevans/sequel/blob/master/lib/sequel/plugins/auto_validations.rb#L226In the meantime, I've suppressed the error by adding
skip_auto_validations :max_value
andskip_auto_validations :min_value
to the model.Just wanted to share this to confirm whether or not this is a legitimate bug. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions