From the manual; can you duplicate the '-ident' condition in the
example to get what you're after?
http://search.cpan.org/~arodland/DBIx-Class-0.08196/lib/DBIx/Class/Relationship/Base.pm
To specify joins which describe more than a simple equality of column
values, the custom join condition coderef syntax can be used. For
example:
My::Schema::Artist-has_many(
cds_80s = 'My::Schema::CD',
sub {
my $args = shift;
return {
$args-{foreign_alias}.artist = { -ident =
$args-{self_alias}.artistid },
$args-{foreign_alias}.year = { '', 1979, '', 1990 },
};
}
);
...
$artist_rs-search_related('cds_80s')-next;
will result in the JOIN clause:
... FROM artist me LEFT JOIN cd cds_80s ON
cds_80s.artist = me.artistid
AND cds_80s.year ?
AND cds_80s.year ?
___
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk