From: Alexander Hartmaier Date: Mon, 4 Oct 2010 15:24:22 +0000 (+0200) Subject: add_relationship without the accessor attribute is invalid X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=3e2e533e6a5cd7953a5e3c5c22e787da7e4451c1;p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate add_relationship without the accessor attribute is invalid --- diff --git a/t/lib/DBSchema/Result/Dvd.pm b/t/lib/DBSchema/Result/Dvd.pm index 0020109..ba34eec 100644 --- a/t/lib/DBSchema/Result/Dvd.pm +++ b/t/lib/DBSchema/Result/Dvd.pm @@ -54,9 +54,10 @@ __PACKAGE__->might_have( liner_notes => 'DBSchema::Result::LinerNotes', undef, { proxy => [ qw/notes/ ] }, ); -__PACKAGE__->add_relationship('like_has_many', 'DBSchema::Result::Twokeys', { 'foreign.dvd_name' => 'self.name' }, { accessor_name => 'like_has_many' } ); +__PACKAGE__->add_relationship('like_has_many', 'DBSchema::Result::Twokeys', { 'foreign.dvd_name' => 'self.name' }, { accessor => 'multi', accessor_name => 'like_has_many' } ); __PACKAGE__->add_relationship('like_has_many2', 'DBSchema::Result::Twokeys_belongsto', { 'foreign.key1' => 'self.twokeysfk' }, + { accessor => 'multi' }, ); 1; diff --git a/t/lib/DBSchema/Result/Twokeys.pm b/t/lib/DBSchema/Result/Twokeys.pm index 7d71d01..ee9f15e 100644 --- a/t/lib/DBSchema/Result/Twokeys.pm +++ b/t/lib/DBSchema/Result/Twokeys.pm @@ -15,7 +15,7 @@ __PACKAGE__->add_columns( ); __PACKAGE__->set_primary_key("dvd_name", "key2"); -__PACKAGE__->add_relationship('like_belongs_to', 'DBSchema::Result::Dvd', { 'foreign.name' => 'self.dvd_name' }, ); +__PACKAGE__->add_relationship('like_belongs_to', 'DBSchema::Result::Dvd', { 'foreign.name' => 'self.dvd_name' }, { accessor => 'single' }); 1;