From: Matt S Trout Date: Sun, 5 Feb 2006 15:28:51 +0000 (+0000) Subject: Fix to find for complex resultsets X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=01bc091e6abf06ee16174d356fd3db09849199d7;p=dbsrgits%2FDBIx-Class-Historic.git Fix to find for complex resultsets --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index a10b504..c7a9cc5 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -224,13 +224,17 @@ sub find { my $query; if (ref $vals[0] eq 'HASH') { - $query = $vals[0]; + $query = { %{$vals[0]} }; } elsif (@cols == @vals) { $query = {}; @{$query}{@cols} = @vals; } else { $query = {@vals}; } + foreach (keys %$query) { + next if m/\./; + $query->{$self->{attrs}{alias}.'.'.$_} = delete $query->{$_}; + } #warn Dumper($query); return $self->search($query)->next; }