Skip to content

fix: changing unique_constraints default#8

Open
davewood wants to merge 1 commit into
gshank:masterfrom
davewood:master
Open

fix: changing unique_constraints default#8
davewood wants to merge 1 commit into
gshank:masterfrom
davewood:master

Conversation

@davewood

Copy link
Copy Markdown

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
Copy Markdown
Author

ping

@davewood

davewood commented Feb 11, 2019

Copy link
Copy Markdown
Author

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