]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/blobdiff - t/lib/DBSchema/Result/Dvd.pm
m2m accepts one element instead of an arrayref; id as generic pk
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / t / lib / DBSchema / Result / Dvd.pm
index e791b76fc721c16e15760fd321fac3ff5dbfbd80..0020109318b104d4a2b222c51bb3e78f02ce77f5 100644 (file)
@@ -8,11 +8,10 @@ use warnings;
 use base 'DBIx::Class';
 use overload '""' => sub {$_[0]->name}, fallback => 1;
 
-use lib '../../DBIx-Class-HTML-FormFu/lib/';
 __PACKAGE__->load_components(qw/IntrospectableM2M Core/);
 __PACKAGE__->table('dvd');
 __PACKAGE__->add_columns(
-  'id' => {
+  'dvd_id' => {
     data_type => 'integer',
     is_auto_increment => 1
   },
@@ -45,11 +44,11 @@ __PACKAGE__->add_columns(
     is_nullable => 1,
   },
 );
-__PACKAGE__->set_primary_key('id');
+__PACKAGE__->set_primary_key('dvd_id');
 __PACKAGE__->belongs_to('owner', 'DBSchema::Result::User', { id => 'owner' });
 __PACKAGE__->belongs_to('current_borrower', 'DBSchema::Result::User', { id => 'current_borrower' });
-__PACKAGE__->has_many('dvdtags', 'Dvdtag', { 'foreign.dvd' => 'self.id' });
-__PACKAGE__->has_many('viewings', 'DBSchema::Result::Viewing', { 'foreign.dvd_id' => 'self.id' });
+__PACKAGE__->has_many('dvdtags', 'Dvdtag', { 'foreign.dvd' => 'self.dvd_id' });
+__PACKAGE__->has_many('viewings', 'DBSchema::Result::Viewing', { 'foreign.dvd_id' => 'self.dvd_id' });
 __PACKAGE__->many_to_many('tags', 'dvdtags' => 'tag');
 __PACKAGE__->might_have(
     liner_notes => 'DBSchema::Result::LinerNotes', undef,
This page took 0.019492 seconds and 4 git commands to generate.