From: Peter Rabbitson Date: Fri, 27 Feb 2009 00:18:15 +0000 (+0000) Subject: Reinstate examples after botched merge X-Git-Tag: v0.08100~75 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4bea50483dab0191d6104461bc9dd97dd9cd115f;p=dbsrgits%2FDBIx-Class.git Reinstate examples after botched merge --- diff --git a/examples/Schema/MyDatabase/Main.pm b/examples/Schema/MyDatabase/Main.pm index 6b9eef7..42fae1b 100644 --- a/examples/Schema/MyDatabase/Main.pm +++ b/examples/Schema/MyDatabase/Main.pm @@ -1,5 +1,5 @@ package MyDatabase::Main; use base qw/DBIx::Class::Schema/; -__PACKAGE__->load_classes(qw/Artist Cd Track/); +__PACKAGE__->load_namespaces; 1; diff --git a/examples/Schema/MyDatabase/Main/Artist.pm b/examples/Schema/MyDatabase/Main/Result/Artist.pm similarity index 65% rename from examples/Schema/MyDatabase/Main/Artist.pm rename to examples/Schema/MyDatabase/Main/Result/Artist.pm index 5f039e6..ec78501 100644 --- a/examples/Schema/MyDatabase/Main/Artist.pm +++ b/examples/Schema/MyDatabase/Main/Result/Artist.pm @@ -1,10 +1,10 @@ -package MyDatabase::Main::Artist; +package MyDatabase::Main::Result::Artist; use base qw/DBIx::Class/; __PACKAGE__->load_components(qw/PK::Auto Core/); __PACKAGE__->table('artist'); __PACKAGE__->add_columns(qw/ artistid name /); __PACKAGE__->set_primary_key('artistid'); -__PACKAGE__->has_many('cds' => 'MyDatabase::Main::Cd'); +__PACKAGE__->has_many('cds' => 'MyDatabase::Main::Result::Cd'); 1; diff --git a/examples/Schema/MyDatabase/Main/Cd.pm b/examples/Schema/MyDatabase/Main/Result/Cd.pm similarity index 51% rename from examples/Schema/MyDatabase/Main/Cd.pm rename to examples/Schema/MyDatabase/Main/Result/Cd.pm index 4579823..83fd21e 100644 --- a/examples/Schema/MyDatabase/Main/Cd.pm +++ b/examples/Schema/MyDatabase/Main/Result/Cd.pm @@ -1,10 +1,10 @@ -package MyDatabase::Main::Cd; +package MyDatabase::Main::Result::Cd; use base qw/DBIx::Class/; __PACKAGE__->load_components(qw/PK::Auto Core/); __PACKAGE__->table('cd'); __PACKAGE__->add_columns(qw/ cdid artist title/); __PACKAGE__->set_primary_key('cdid'); -__PACKAGE__->belongs_to('artist' => 'MyDatabase::Main::Artist'); -__PACKAGE__->has_many('tracks' => 'MyDatabase::Main::Track'); +__PACKAGE__->belongs_to('artist' => 'MyDatabase::Main::Result::Artist'); +__PACKAGE__->has_many('tracks' => 'MyDatabase::Main::Result::Track'); 1; diff --git a/examples/Schema/MyDatabase/Main/Track.pm b/examples/Schema/MyDatabase/Main/Result/Track.pm similarity index 65% rename from examples/Schema/MyDatabase/Main/Track.pm rename to examples/Schema/MyDatabase/Main/Result/Track.pm index 3710406..23877bb 100644 --- a/examples/Schema/MyDatabase/Main/Track.pm +++ b/examples/Schema/MyDatabase/Main/Result/Track.pm @@ -1,9 +1,9 @@ -package MyDatabase::Main::Track; +package MyDatabase::Main::Result::Track; use base qw/DBIx::Class/; __PACKAGE__->load_components(qw/PK::Auto Core/); __PACKAGE__->table('track'); __PACKAGE__->add_columns(qw/ trackid cd title/); __PACKAGE__->set_primary_key('trackid'); -__PACKAGE__->belongs_to('cd' => 'MyDatabase::Main::Cd'); +__PACKAGE__->belongs_to('cd' => 'MyDatabase::Main::Result::Cd'); 1; diff --git a/examples/Schema/testdb.pl b/examples/Schema/testdb.pl index b31773d..9ca3e39 100644 --- a/examples/Schema/testdb.pl +++ b/examples/Schema/testdb.pl @@ -26,7 +26,6 @@ sub get_tracks_by_cd { }, { join => [qw/ cd /], - prefetch => [qw/ cd /] } ); while (my $track = $rs->next) { @@ -79,7 +78,6 @@ sub get_cds_by_artist { }, { join => [qw/ artist /], - prefetch => [qw/ artist /] } ); while (my $cd = $rs->next) {