[Bast-commits] r5594 - in DBIx-Class/0.08/trunk/t: . 96multi_create lib/DBICTest/Schema

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Fri Feb 20 09:17:22 GMT 2009


Author: ribasushi
Date: 2009-02-20 09:17:21 +0000 (Fri, 20 Feb 2009)
New Revision: 5594

Modified:
   DBIx-Class/0.08/trunk/t/96multi_create.t
   DBIx-Class/0.08/trunk/t/96multi_create/cd_single.t
   DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Track.pm
Log:
Ordered now works correctly with MC too \o/

Modified: DBIx-Class/0.08/trunk/t/96multi_create/cd_single.t
===================================================================
--- DBIx-Class/0.08/trunk/t/96multi_create/cd_single.t	2009-02-20 08:16:48 UTC (rev 5593)
+++ DBIx-Class/0.08/trunk/t/96multi_create/cd_single.t	2009-02-20 09:17:21 UTC (rev 5594)
@@ -12,7 +12,6 @@
   my $cd = $schema->resultset('CD')->first;
   my $track = $schema->resultset('Track')->new_result({
     cd => $cd,
-    position => 77,  # some day me might test this with Ordered
     title => 'Multicreate rocks',
     cd_single => {
       artist => $cd->artist,

Modified: DBIx-Class/0.08/trunk/t/96multi_create.t
===================================================================
--- DBIx-Class/0.08/trunk/t/96multi_create.t	2009-02-20 08:16:48 UTC (rev 5593)
+++ DBIx-Class/0.08/trunk/t/96multi_create.t	2009-02-20 09:17:21 UTC (rev 5594)
@@ -91,9 +91,9 @@
       title => 'Bad investment',
       year => 2008,
       tracks => [
-        { position => 1, title => 'Just buy' },
-        { position => 2, title => 'Why did we do it' },
-        { position => 3, title => 'Burn baby burn' },
+        { title => 'Just buy' },
+        { title => 'Why did we do it' },
+        { title => 'Burn baby burn' },
       ],
     },
     producer => {
@@ -133,19 +133,17 @@
     year => 2008,
     tracks => [
       {
-        position => 1, # some day me might test this with Ordered
         title => 'Off by one again',
       },
       {
-        position => 2,
         title => 'The dereferencer',
         cd_single => {
           artist => $artist,
           year => 2008,
           title => 'Was that a null (Single)',
           tracks => [
-            { title => 'The dereferencer', position => 1 },
-            { title => 'The dereferencer II', position => 2 },
+            { title => 'The dereferencer' },
+            { title => 'The dereferencer II' },
           ],
           cd_to_producer => [
             {
@@ -204,16 +202,15 @@
   my $cd = $schema->resultset('CD')->first;
   my $track = $schema->resultset('Track')->create ({
     cd => $cd,
-    position => 77,  # some day me might test this with Ordered
     title => 'Multicreate rocks',
     cd_single => {
       artist => $cd->artist,
       year => 2008,
       title => 'Disemboweling MultiCreate',
       tracks => [
-        { title => 'Why does mst write this way', position => 1 },
-        { title => 'Chainsaw celebration', position => 2 },
-        { title => 'Purl cleans up', position => 3 },
+        { title => 'Why does mst write this way' },
+        { title => 'Chainsaw celebration' },
+        { title => 'Purl cleans up' },
       ],
       cd_to_producer => [
         {
@@ -303,7 +300,6 @@
   my $cd = $schema->resultset('CD')->first;
   my $track = $schema->resultset ('Track')->create ({
     cd => $cd,
-    position => 66,
     title => 'Black',
     lyrics => {
       lyric_versions => [
@@ -441,13 +437,8 @@
 		title => 'TestOneCD1',
 		year => 2007,
 		tracks => [
-		
-			{ position=>111,
-			  title => 'TrackOne',
-			},
-			{ position=>112,
-			  title => 'TrackTwo',
-			}
+			{ title => 'TrackOne' },
+			{ title => 'TrackTwo' },
 		],
 
 	});
@@ -475,13 +466,8 @@
 		title => 'TestOneCD2',
 		year => 2007,
 		tracks => [
-		
-			{ position=>111,
-			  title => 'TrackOne',
-			},
-			{ position=>112,
-			  title => 'TrackTwo',
-			}
+			{ title => 'TrackOne' },
+			{ title => 'TrackTwo' },
 		],
 
     liner_notes => { notes => 'I can haz liner notes?' },

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Track.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Track.pm	2009-02-20 08:16:48 UTC (rev 5593)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/Schema/Track.pm	2009-02-20 09:17:21 UTC (rev 5594)
@@ -2,7 +2,7 @@
     DBICTest::Schema::Track;
 
 use base 'DBIx::Class::Core';
-__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
+__PACKAGE__->load_components(qw/InflateColumn::DateTime Ordered/);
 
 __PACKAGE__->table('track');
 __PACKAGE__->add_columns(
@@ -32,6 +32,10 @@
 __PACKAGE__->add_unique_constraint([ qw/cd position/ ]);
 __PACKAGE__->add_unique_constraint([ qw/cd title/ ]);
 
+__PACKAGE__->position_column ('position');
+__PACKAGE__->grouping_column ('cd');
+
+
 __PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD' );
 __PACKAGE__->belongs_to( disc => 'DBICTest::Schema::CD' => 'cd');
 




More information about the Bast-commits mailing list