X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship%2FBase.pm;h=ab7f33cd7420520b945f46f35deddcee51e43b92;hp=e0007ffee6fa27f263f22fea8e13b2cb98400ba0;hb=4006691d207a6c257012c4b9a07d674b211349b0;hpb=12b348d9331e09e2a7ab55bf57fbc33476cf174c diff --git a/lib/DBIx/Class/Relationship/Base.pm b/lib/DBIx/Class/Relationship/Base.pm index e0007ff..ab7f33c 100644 --- a/lib/DBIx/Class/Relationship/Base.pm +++ b/lib/DBIx/Class/Relationship/Base.pm @@ -475,7 +475,9 @@ sub related_resultset { return $self->{related_resultsets}{$rel} = do { - my $rel_info = $self->relationship_info($rel) + my $rsrc = $self->result_source; + + my $rel_info = $rsrc->relationship_info($rel) or $self->throw_exception( "No such relationship '$rel'" ); my $attrs = (@_ > 1 && ref $_[$#_] eq 'HASH' ? pop(@_) : {}); @@ -485,8 +487,6 @@ sub related_resultset { if (@_ > 1 && (@_ % 2 == 1)); my $query = ((@_ > 1) ? {@_} : shift); - my $rsrc = $self->result_source; - # condition resolution may fail if an incomplete master-object prefetch # is encountered - that is ok during prefetch construction (not yet in_storage) my ($cond, $is_crosstable) = try {