Hi, 
I'm currently trying to move my application from CDBI to Dbix::Class.

Now I have a many_to many relationship and I want to do a search on the 
related table as described in the pod. yet I get an errror:

DBIx::Class::Relationship::Base::search_related(): No such relationship motive 
at t/05_format.t line 26

yet, doing fetching all objects works for both directions,

the lines are : 
PW::DB::Format.pm :

...
__PACKAGE__->has_many(mformate   => 'PW::DB::MFormat', 'format_id');
__PACKAGE__->many_to_many('motive' => 'mformate', 'motiv_id');


PW::DB::Motiv.pm :
...
__PACKAGE__->has_many( mformate  => 'PW::DB::MFormat', 'motiv_id');
__PACKAGE__->many_to_many('formate' => 'mformate', 'format_id');

and   t/05_format.t 
...
my $f = $s->resultset('Format')->find(31);
my $m = $f->motive();
is ($m->count, 119,'Motive zu Format');

my $ap = $f->search_related('motive', {name=>'Airplane'});
---------

so  $f->motive() works,  
$f->search_related('motive', {name=>'Airplane'});
gives the error above.

What's wrong ?

Rolf Schauflberger
[EMAIL PROTECTED]

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to