Anthony Gladdish wrote:
> Hi,
> 
> Upgrading from:
> 
> DBIC v0.08010 
> SQL:Abstract v1.24 
> 
> to:
> 
> DBIC v0.08012 
> SQL:Abstract v1.5

08010 and 08012 are identical (it was a maintenance release, no functional 
changes at all)

> My ResultSet method contains following search:
> 
> my $orders_current = $schema->resultset('Order')->search(
>         {
>             -and => [
>                 -or => [
>                     "module_access.expires" => { ">", DateTime->now() },
>                     "scheme_access.expires" => { ">", DateTime->now() },
>                 ],
>                 "me.person" => $self->id(),
>             ],  
>         },        
>         {
>             distinct => 1,
>             join => ['module_access','scheme_access'],
>         }
>     );
> 

This looks like improper syntax to me. The -[and|or|nest] modifiers are
explicitly said to work in an arrayref only, yet you plug -and into a
hashref. The proper way to express what you want is (I think):

->search(
         [
             -and => [
                 [
                     "module_access.expires" => { ">", DateTime->now() },
                     "scheme_access.expires" => { ">", DateTime->now() },
                 ],
                 "me.person" => $self->id(),
             ],
         ],
         ...

>From the DBIC 0.08012 cookbook "Complex WHERE clauses" documentation, it looks 
>like my original search() should work?!

Indeed the book refers to modifiers within a hashref. Someone care to comment?

_______________________________________________
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