backport Ash's quoting fix from Loader to columns_info_for
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSource.pm
index e9c9e90..dbbe1ad 100644 (file)
@@ -202,8 +202,8 @@ sub column_info {
        and $self->schema and $self->storage )
   {
     $self->{_columns_info_loaded}++;
-    my $info;
-    my $lc_info;
+    my $info = {};
+    my $lc_info = {};
     # eval for the case of storage without table
     eval { $info = $self->storage->columns_info_for( $self->from ) };
     unless ($@) {
@@ -211,7 +211,10 @@ sub column_info {
         $lc_info->{lc $realcol} = $info->{$realcol};
       }
       foreach my $col ( keys %{$self->_columns} ) {
-        $self->_columns->{$col} = { %{ $self->_columns->{$col}}, %{$info->{$col} || $lc_info->{lc $col}} };
+        $self->_columns->{$col} = {
+          %{ $self->_columns->{$col} },
+          %{ $info->{$col} || $lc_info->{lc $col} || {} }
+        };
       }
     }
   }
@@ -949,7 +952,9 @@ L<DBIx::Class::ResultSet>, and set it here.
 
   $source->resultset_attributes({ order_by => [ 'id' ] });
 
-Specify here any attributes you wish to pass to your specialised resultset.
+Specify here any attributes you wish to pass to your specialised
+resultset. For a full list of these, please see
+L<DBIx::Class::ResultSet/ATTRIBUTES>.
 
 =cut