- Storage/DBI.pm now uses Abstract internally
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / ImaDBI.pm
index 08a72d8..f659983 100644 (file)
@@ -84,11 +84,23 @@ sub set_sql {
     *{"${class}::search_${name}"} =
       sub {
         my ($class, @args) = @_;
-        $class->sth_to_objects($class->$meth, \@args);
+        my $sth = $class->$meth;
+        $sth->execute(@args);
+        return $class->sth_to_objects($sth);
       };
   }
 }
 
+sub sth_to_objects {
+  my ($class, $sth) = @_;
+  my @cols = $class->_select_columns;
+  my @ret;
+  while (my @row = $sth->fetchrow_array) {
+    push(@ret, $class->_row_to_object(\@cols,\@row));
+  }
+  return @ret;
+}
+
 sub transform_sql {
   my ($class, $sql, @args) = @_;
   my $table = $class->_table_name;