X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FArtist.pm;h=79132fb166e598a2f1936aa58c3c5b1a7dcb1102;hb=refs%2Fheads%2Fcurrent%2Fdq;hp=82423fda694e5f9dbc783a3dfdd752c6493a645f;hpb=a63c42fc0b2844ff59bc86719fbe2c779067f171;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Artist.pm index 82423fd..79132fb 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Artist.pm @@ -149,6 +149,21 @@ __PACKAGE__->has_many( ); __PACKAGE__->many_to_many('artworks', 'artwork_to_artist', 'artwork'); +__PACKAGE__->has_many( + cds_without_genre => 'DBICTest::Schema::CD', + sub { + my $args = shift; + return ( + { + "$args->{foreign_alias}.artist" => { -ident => "$args->{self_alias}.artistid" }, + "$args->{foreign_alias}.genreid" => undef, + }, $args->{self_rowobj} && { + "$args->{foreign_alias}.artist" => $args->{self_rowobj}->artistid, + "$args->{foreign_alias}.genreid" => undef, + } + ), + }, +); sub sqlt_deploy_hook { my ($self, $sqlt_table) = @_;