X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSource.pm;h=6ac8538a664ef48a167ec95d7ca9a046ebea4271;hb=52b420dd006f55aced42c669f49182890b8826ea;hp=171218bd72c5633980ebaf3fdec1615f4a03c4e1;hpb=0d7d16dd7fa107999e0a89fdbd954a3a261d81e2;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 171218b..6ac8538 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -368,11 +368,10 @@ sub column_info { $self->{_columns_info_loaded}++; my $info = {}; my $lc_info = {}; + # try for the case of storage without table - my $caught; - try { $info = $self->storage->columns_info_for( $self->from ) } - catch { $caught = 1 }; - unless ($caught) { + try { + $info = $self->storage->columns_info_for( $self->from ); for my $realcol ( keys %{$info} ) { $lc_info->{lc $realcol} = $info->{$realcol}; } @@ -382,7 +381,7 @@ sub column_info { %{ $info->{$col} || $lc_info->{lc $col} || {} } }; } - } + }; } return $self->_columns->{$column}; } @@ -1025,7 +1024,7 @@ sub add_relationship { return $self; - # XXX disabled. doesn't work properly currently. skip in tests. +# XXX disabled. doesn't work properly currently. skip in tests. my $f_source = $self->schema->source($f_source_name); unless ($f_source) { @@ -1041,10 +1040,11 @@ sub add_relationship { try { $self->_resolve_join($rel, 'me', {}, []) } catch { # If the resolve failed, back out and re-throw the error - delete $rels{$rel}; # + delete $rels{$rel}; $self->_relationships(\%rels); $self->throw_exception("Error creating relationship $rel: $_"); }; + 1; }