On Tue, Jul 12, 2011 at 6:42 PM, Marc Logghe <[email protected]> wrote:

> Hi,
> I wanted to add an extra condition in a join like this:
>
> $lite_schema->class('Thingy')->add_relationship(
>    "fixed_position",
>   "Foo::Bar",
>   { 'foreign.thingy_number' => 'self.thingy_num', 'foreign.library' => {
> '=' => $library}},
>   { join_type => 'left outer'}
>   );
>
>
>
OK for the record, checked DBIC::ResultSource and it is not supported.
However, this does the trick if the condition hash is replaced by:

  sub {
      my $args = shift;

      return {
        "$args->{foreign_alias}.thingy_number" => { -ident =>
"$args->{self_alias}.thingy_num" },
        "$args->{foreign_alias}.library"   => { '=' => $library},
      };
    }

cheers,
Marc
_______________________________________________
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/[email protected]

Reply via email to