From: luke Date: Mon, 25 May 2009 22:25:35 +0000 (+0000) Subject: switched to namespaces X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dd6408a63a97eaad4e7e8909b040a0d414fc9625;p=dbsrgits%2FDBIx-Class-ResultSet-WithMetaData.git switched to namespaces --- diff --git a/t/lib/DBICTest/Schema.pm b/t/lib/DBICTest/Schema.pm index 350eecc..0142bc9 100644 --- a/t/lib/DBICTest/Schema.pm +++ b/t/lib/DBICTest/Schema.pm @@ -5,6 +5,6 @@ use base qw/DBIx::Class::Schema/; no warnings qw/qw/; -__PACKAGE__->load_classes(qw/Artist CD Track Tag Producer CD_to_Producer/); +__PACKAGE__->load_namespaces; 1; diff --git a/t/lib/DBICTest/Schema/Artist.pm b/t/lib/DBICTest/Schema/Result/Artist.pm similarity index 81% rename from t/lib/DBICTest/Schema/Artist.pm rename to t/lib/DBICTest/Schema/Result/Artist.pm index 594a76d..06f36fd 100644 --- a/t/lib/DBICTest/Schema/Artist.pm +++ b/t/lib/DBICTest/Schema/Result/Artist.pm @@ -1,5 +1,5 @@ package # hide from PAUSE - DBICTest::Schema::Artist; + DBICTest::Schema::Result::Artist; use base 'DBIx::Class::Core'; @@ -18,7 +18,7 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key('artistid'); __PACKAGE__->has_many( - cds => 'DBICTest::Schema::CD', undef, + cds => 'DBICTest::Schema::Result::CD', undef, { order_by => 'year' }, ); diff --git a/t/lib/DBICTest/Schema/CD.pm b/t/lib/DBICTest/Schema/Result/CD.pm similarity index 71% rename from t/lib/DBICTest/Schema/CD.pm rename to t/lib/DBICTest/Schema/Result/CD.pm index a6f084f..60dbd38 100644 --- a/t/lib/DBICTest/Schema/CD.pm +++ b/t/lib/DBICTest/Schema/Result/CD.pm @@ -1,5 +1,5 @@ package # hide from PAUSE - DBICTest::Schema::CD; + DBICTest::Schema::Result::CD; use base 'DBIx::Class::Core'; @@ -24,15 +24,15 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key('cdid'); __PACKAGE__->add_unique_constraint([ qw/artist title/ ]); -__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' ); +__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Result::Artist' ); -__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' ); +__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Result::Track' ); __PACKAGE__->has_many( - tags => 'DBICTest::Schema::Tag', undef, + tags => 'DBICTest::Schema::Result::Tag', undef, { order_by => 'tag' }, ); __PACKAGE__->has_many( - cd_to_producer => 'DBICTest::Schema::CD_to_Producer' => 'cd' + cd_to_producer => 'DBICTest::Schema::Result::CD_to_Producer' => 'cd' ); __PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' ); diff --git a/t/lib/DBICTest/Schema/CD_to_Producer.pm b/t/lib/DBICTest/Schema/Result/CD_to_Producer.pm similarity index 74% rename from t/lib/DBICTest/Schema/CD_to_Producer.pm rename to t/lib/DBICTest/Schema/Result/CD_to_Producer.pm index 117a590..a40d605 100644 --- a/t/lib/DBICTest/Schema/CD_to_Producer.pm +++ b/t/lib/DBICTest/Schema/Result/CD_to_Producer.pm @@ -1,5 +1,5 @@ package # hide from PAUSE - DBICTest::Schema::CD_to_Producer; + DBICTest::Schema::Result::CD_to_Producer; use base 'DBIx::Class::Core'; @@ -11,12 +11,12 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key(qw/cd producer/); __PACKAGE__->belongs_to( - 'cd', 'DBICTest::Schema::CD', + 'cd', 'DBICTest::Schema::Result::CD', { 'foreign.cdid' => 'self.cd' } ); __PACKAGE__->belongs_to( - 'producer', 'DBICTest::Schema::Producer', + 'producer', 'DBICTest::Schema::Result::Producer', { 'foreign.producerid' => 'self.producer' } ); diff --git a/t/lib/DBICTest/Schema/Producer.pm b/t/lib/DBICTest/Schema/Result/Producer.pm similarity index 90% rename from t/lib/DBICTest/Schema/Producer.pm rename to t/lib/DBICTest/Schema/Result/Producer.pm index 036f9f2..4a727dd 100644 --- a/t/lib/DBICTest/Schema/Producer.pm +++ b/t/lib/DBICTest/Schema/Result/Producer.pm @@ -1,5 +1,5 @@ package # hide from PAUSE - DBICTest::Schema::Producer; + DBICTest::Schema::Result::Producer; use base 'DBIx::Class::Core'; diff --git a/t/lib/DBICTest/Schema/Tag.pm b/t/lib/DBICTest/Schema/Result/Tag.pm similarity index 77% rename from t/lib/DBICTest/Schema/Tag.pm rename to t/lib/DBICTest/Schema/Result/Tag.pm index b75c2ef..6a6c451 100644 --- a/t/lib/DBICTest/Schema/Tag.pm +++ b/t/lib/DBICTest/Schema/Result/Tag.pm @@ -1,5 +1,5 @@ package # hide from PAUSE - DBICTest::Schema::Tag; + DBICTest::Schema::Result::Tag; use base qw/DBIx::Class::Core/; @@ -19,6 +19,6 @@ __PACKAGE__->add_columns( ); __PACKAGE__->set_primary_key('tagid'); -__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD' ); +__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::Result::CD' ); 1; diff --git a/t/lib/DBICTest/Schema/Track.pm b/t/lib/DBICTest/Schema/Result/Track.pm similarity index 87% rename from t/lib/DBICTest/Schema/Track.pm rename to t/lib/DBICTest/Schema/Result/Track.pm index 3f224d5..f243e81 100644 --- a/t/lib/DBICTest/Schema/Track.pm +++ b/t/lib/DBICTest/Schema/Result/Track.pm @@ -1,5 +1,5 @@ package # hide from PAUSE - DBICTest::Schema::Track; + DBICTest::Schema::Result::Track; use base 'DBIx::Class::Core'; __PACKAGE__->load_components(qw/InflateColumn::DateTime/); @@ -32,6 +32,6 @@ __PACKAGE__->set_primary_key('trackid'); __PACKAGE__->add_unique_constraint([ qw/cd position/ ]); __PACKAGE__->add_unique_constraint([ qw/cd title/ ]); -__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD' ); +__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::Result::CD' ); 1;