X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FSchema%2FCD.pm;h=1463d0036309f3f466348e6b52de45d6ab07e533;hb=18129e8117befc4681180910901210aeef4fdf42;hp=5638e242e4ada9840a17d3330ca60b62dc8b2a90;hpb=b818fc5dc8552b93b5b723ebff87b804b662d3dd;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/Schema/CD.pm b/t/lib/DBICTest/Schema/CD.pm index 5638e24..1463d00 100644 --- a/t/lib/DBICTest/Schema/CD.pm +++ b/t/lib/DBICTest/Schema/CD.pm @@ -1,9 +1,12 @@ package # hide from PAUSE DBICTest::Schema::CD; -use base 'DBIx::Class::Core'; +use base qw/DBICTest::BaseResult/; + +# this tests table name as scalar ref +# DO NOT REMOVE THE \ +__PACKAGE__->table(\'cd'); -__PACKAGE__->table('cd'); __PACKAGE__->add_columns( 'cdid' => { data_type => 'integer', @@ -38,7 +41,9 @@ __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, { }); # in case this is a single-cd it promotes a track from another cd -__PACKAGE__->belongs_to( single_track => 'DBICTest::Schema::Track' ); +__PACKAGE__->belongs_to( single_track => 'DBICTest::Schema::Track', 'single_track', + { join_type => 'left'} +); __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' ); __PACKAGE__->has_many( @@ -54,6 +59,7 @@ __PACKAGE__->might_have( { proxy => [ qw/notes/ ] }, ); __PACKAGE__->might_have(artwork => 'DBICTest::Schema::Artwork', 'cd_id'); +__PACKAGE__->has_one(mandatory_artwork => 'DBICTest::Schema::Artwork', 'cd_id'); __PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' ); __PACKAGE__->many_to_many(