good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thanks again for your response.
I am using MooseX. The issue is resolved. Instead of building the WHERE clause in $whrcls, I simply added the complete DBIx::Class search within the if/else statement: method get_colors( $id, $color1, $color2 ){ my @mycolor_objs; if(!$color2){ @mycolor_objs = $schema->resultset( 'TblColors' )->search({ ID => $id, color => $color1 }, { order_by => 'ID' }); } else { @myscolor_objs = $schema->resultset( 'TblColors' )->search({ ID => $id, -or => [ color => $color1, color => $color2 ] }, { order_by => 'ID' }); } } I am unsure at this moment, but it seems DBIx::Class is a little sensitive when using a scalar to represent the hash being passed as the WHERE clause. Thanks again. When I have a little more time, I will research building WHERE clauses with scalars. In reply to Re^4: Querying data with and & or when using DBIx::Class
by phildeman
|
|