Replies: 1 comment 5 replies
-
I don't want to make constraint_validations or class_table_inheritance to have dependencies on the other one. The best fix in this case would be a small plugin that depends on both and has the necessary glue code. Does that sound like something you would be willing to work on? If not, I can add this to my todo list, but it wouldn't be high priority. Also, not sure if you are using PostgreSQL, but if so, you could also consider the pg_auto_constraint_validations plugin. It works a little differently, rescuing the Sequel::CheckConstraintViolation and reraising as a ValidationFailed. |
Beta Was this translation helpful? Give feedback.
5 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.
-
I'm running into an issue using class_table_inheritance with the constraint_validations plugin. When I'm expecting to get a
Sequel::ValidationFailed
error I'm instead gettingSequel::CheckConstraintViolation
errorsHere is a small example
In both of those I was hoping to trigger a
Sequel::ValidationFailed
but both cases are raising aSequel::CheckConstraintViolation
I think it's related to the table name that the plugin is using to look up the constraint in the validations table. Using the code from
parse_constraint_validations
sequel/lib/sequel/plugins/constraint_validations.rb
Lines 125 to 126 in e0c99f6
The
Manager
table_name isThe
tables
in the constraint validations table look correct to meBeta Was this translation helpful? Give feedback.
All reactions