[Bast-commits] r6739 - DBIx-Class/0.08/trunk/lib/DBIx/Class

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Sat Jun 20 13:22:06 GMT 2009


Author: ribasushi
Date: 2009-06-20 13:22:06 +0000 (Sat, 20 Jun 2009)
New Revision: 6739

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
Log:
Disambiguate populate() return

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm	2009-06-20 10:54:11 UTC (rev 6738)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm	2009-06-20 13:22:06 UTC (rev 6739)
@@ -1514,8 +1514,9 @@
 to insert the data, as this is a faster method.
 
 Otherwise, each set of data is inserted into the database using
-L<DBIx::Class::ResultSet/create>, and a arrayref of the resulting row
-objects is returned.
+L<DBIx::Class::ResultSet/create>, and the resulting objects are
+accumulated into an array. The array itself, or an array reference
+is returned depending on scalar or list context.
 
 Example:  Assuming an Artist Class that has many CDs Classes relating:
 
@@ -1581,7 +1582,7 @@
     foreach my $item (@$data) {
       push(@created, $self->create($item));
     }
-    return @created;
+    return wantarray ? @created : \@created;
   } else {
     my ($first, @rest) = @$data;
 




More information about the Bast-commits mailing list