Added a note about select
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSet.pm
index 31bc5b4..ca16242 100644 (file)
@@ -1796,8 +1796,10 @@ sub populate {
   } else {
     my ($first, @rest) = @$data;
 
+    require overload;
     my @names = grep {
-      (not ref $first->{$_}) || (ref $first->{$_} eq 'SCALAR')
+      (not ref $first->{$_}) || (ref $first->{$_} eq 'SCALAR') ||
+        (overload::Method($first->{$_}, '""'))
     } keys %$first;
 
     my @rels = grep { $self->result_source->has_relationship($_) } keys %$first;
@@ -3258,6 +3260,9 @@ When you use function/stored procedure names and do not supply an C<as>
 attribute, the column names returned are storage-dependent. E.g. MySQL would
 return a column named C<count(employeeid)> in the above example.
 
+B<NOTE:> You will almost always need a corresponding 'as' entry when you use
+'select'.
+
 =head2 +select
 
 =over 4