From: Rob Kinyon Date: Thu, 19 Mar 2009 21:07:06 +0000 (+0000) Subject: Commit another fix for arcanez to test X-Git-Tag: v0.08100~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=869e9aac2fdd3be4c3a3b3bf2af0935432ee0690;p=dbsrgits%2FDBIx-Class.git Commit another fix for arcanez to test --- diff --git a/lib/DBIx/Class/CDBICompat/Retrieve.pm b/lib/DBIx/Class/CDBICompat/Retrieve.pm index 564583a..e701cfc 100644 --- a/lib/DBIx/Class/CDBICompat/Retrieve.pm +++ b/lib/DBIx/Class/CDBICompat/Retrieve.pm @@ -67,7 +67,7 @@ sub retrieve_from_sql { $attrs{group_by} = $1; } - return $class->search_literal($cond, ( %attrs || () ) ); + return $class->search_literal($cond, @rest, ( %attrs ? \%attrs : () ) ); } sub construct { diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 5253777..db03b46 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -411,7 +411,11 @@ require C. sub search_literal { my ($self, $sql, @bind) = @_; - return $self->search(\[ $sql, map [ __DUMMY__ => $_ ], @bind ]); + my $attr; + if ( @bind && ref($bind[-1]) eq 'HASH' ) { + $attr = pop @bind; + } + return $self->search(\[ $sql, map [ __DUMMY__ => $_ ], @bind ], ($attr || () )); } =head2 find