Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: changing unique_constraints default #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix: changing unique_constraints default #8

wants to merge 1 commit into from

Conversation

davewood
Copy link

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.

... so you need to override '_build_unique_constraints'
instead of setting a default for the 'unique_constraints'
attribute.
@davewood
Copy link
Author

ping

@davewood
Copy link
Author

davewood commented Feb 11, 2019

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'] };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant