html-formhandler-model-dbic
html-formhandler-model-dbic copied to clipboard
fix: changing unique_constraints default
hfh checks all unique constraints of the result source by default.
opting out of this doesnt work as described in the docs because the unique_constraints uses lazy_build and a separate build sub and not default.
... so you need to override '_build_unique_constraints' instead of setting a default for the 'unique_constraints' attribute.
ping
workaround
#package MyApp::Schema::Result::Foo;
__PACKAGE__->add_unique_constraint('my_unique_constraint_name' => [qw/ bar baz /]);
#package MyApp::Web::Form::Foo;
override '_build_unique_constraints' => sub { ['my_unique_constraint_name'] };