From: Paul Makepeace Date: Mon, 7 Nov 2005 18:18:48 +0000 (+0000) Subject: Remove the dubious primary keys check. Not clear it's useful or valid. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9a720616d9467c684af10632009ef50d0797bd96;p=dbsrgits%2FDBIx-Class-Historic.git Remove the dubious primary keys check. Not clear it's useful or valid. --- diff --git a/lib/DBIx/Class/Relationship/BelongsTo.pm b/lib/DBIx/Class/Relationship/BelongsTo.pm index ce74d85..0cc441e 100644 --- a/lib/DBIx/Class/Relationship/BelongsTo.pm +++ b/lib/DBIx/Class/Relationship/BelongsTo.pm @@ -28,17 +28,10 @@ sub belongs_to { last; } $cond_rel->{"foreign.$_"} = "self.".$cond->{$_}; - # primary key usage checks - if (exists $f_primaries{$_}) { - delete $f_primaries{$_}; - } elsif ($f_loaded) { - $class->throw("non primary key used in join condition: $_"); - } } - $class->throw("Invalid belongs_to specification for ${rel} on ${class}; primary key columns ".join(', ', keys %f_primaries)." of ${f_class} not specified in join condition") if ($f_loaded && keys %f_primaries); $class->add_relationship($rel, $f_class, $cond_rel, - { accessor => 'single', %{$attrs ||{}} } + { accessor => 'single', %{$attrs || {}} } ); } return 1;