From: Peter Rabbitson Date: Sun, 14 Sep 2014 18:00:40 +0000 (+0200) Subject: Adjust for SQLA's API change 966200cc8 X-Git-Tag: v0.082800~48 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5379386ef2b88e002a778e02132b1f58adf31152;hp=9ac3347b9d86da4e8d2490d72ec4da05ee346bb4;p=dbsrgits%2FDBIx-Class.git Adjust for SQLA's API change 966200cc8 --- diff --git a/lib/DBIx/Class/Storage/DBIHacks.pm b/lib/DBIx/Class/Storage/DBIHacks.pm index 4c07f5e..17fdbfb 100644 --- a/lib/DBIx/Class/Storage/DBIHacks.pm +++ b/lib/DBIx/Class/Storage/DBIHacks.pm @@ -1124,8 +1124,8 @@ sub _collapse_cond { for my $col ( grep { $_ !~ /^\-/ } keys %$fin ) { next unless ref $fin->{$col} eq 'ARRAY' and ($fin->{$col}[0]||'') =~ /^\-and$/i; my $val_bag = { map { - (! defined $_ ) ? ( UNDEF => undef ) - : ( ! ref $_ or is_plain_value $_ ) ? ( "VAL_$_" => $_ ) + (! defined $_ ) ? ( UNDEF => undef ) + : ( ! length ref $_ or is_plain_value $_ ) ? ( "VAL_$_" => $_ ) : ( ( 'SER_' . serialize $_ ) => $_ ) } @{$fin->{$col}}[1 .. $#{$fin->{$col}}] }; @@ -1233,7 +1233,7 @@ sub _collapse_cond_unroll_pairs { and my $vref = is_plain_value( (values %$rhs)[0] ) ) { - push @conds, { $lhs => { $subop => @$vref } } + push @conds, { $lhs => { $subop => $$vref } } } else { push @conds, { $lhs => $rhs }; diff --git a/t/search/stack_cond.t b/t/search/stack_cond.t index d43f274..9a0e806 100644 --- a/t/search/stack_cond.t +++ b/t/search/stack_cond.t @@ -50,9 +50,9 @@ for my $c ( if (my $v = is_plain_value($c->{cond})) { push @query_steps, - { year => $v->[0] }, - { title => $v->[0] }, - { -and => [ year => $v->[0], title => $v->[0] ] }, + { year => $$v }, + { title => $$v }, + { -and => [ year => $$v, title => $$v ] }, ; }