X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSource.pm;h=482990419d1b7c98872f9d20358dd2a2acfd7e12;hb=6909ab3ccc795859d538010083cdafe77e225980;hp=262e2d8ca89c28ca7c366cb4492bd906c79b0955;hpb=7ed4b48f691b78a3d832266d3a253a4d5c6a4837;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 262e2d8..4829904 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -1320,10 +1320,11 @@ sub add_relationship { # Check foreign and self are right in cond if ( (ref $cond ||'') eq 'HASH') { - for (keys %$cond) { - $self->throw_exception("Keys of condition should be of form 'foreign.col', not '$_'") - if /\./ && !/^foreign\./; - } + $_ =~ /^foreign\./ or $self->throw_exception("Malformed relationship condition key '$_': must be prefixed with 'foreign.'") + for keys %$cond; + + $_ =~ /^self\./ or $self->throw_exception("Malformed relationship condition value '$_': must be prefixed with 'self.'") + for values %$cond; } my %rels = %{ $self->_relationships };