Files
ubicloud/db.rb
Jeremy Evans cf0d7c1c46 Use the Sequel pg_auto_validate_enums plugin to automatically validate enum values
Invalid enum values would previously result in a Sequel::DatabaseError
(wrapping PG::InvalidTextRepresentation) when saving.  This changes
the behavior from an unhandled exception 500 error to a nice 400 error.

We previously had manually validations in LoadBalancer for the enum
values.  This removes those.  Only change in the tests is to an error
message, and I think the new error message is nicer.

In order for this to work, the Database needs to use the pg_enum plugin,
so this uses that and regenerates the schema cache with it.
2025-03-14 14:25:16 -07:00

2.0 KiB