From: Matt S Trout Date: Mon, 1 Aug 2005 22:22:14 +0000 (+0000) Subject: add_relatinship now barfs without join condition X-Git-Tag: v0.03001~109 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c6ae274c71a2900a1ab816448ebfb9297bcb84f;p=dbsrgits%2FDBIx-Class.git add_relatinship now barfs without join condition --- diff --git a/lib/DBIx/Class/Relationship.pm b/lib/DBIx/Class/Relationship.pm index 1106f28..a13c0e3 100644 --- a/lib/DBIx/Class/Relationship.pm +++ b/lib/DBIx/Class/Relationship.pm @@ -27,6 +27,7 @@ on searches. sub add_relationship { my ($class, $rel, $f_class, $cond, $attrs) = @_; + die "Can't create relationship without join condition" unless $cond; my %rels = %{ $class->_relationships }; $rels{$rel} = { class => $f_class, cond => $cond, diff --git a/t/06relationship.t b/t/06relationship.t index 7a28841..d0ed1c8 100644 --- a/t/06relationship.t +++ b/t/06relationship.t @@ -39,4 +39,4 @@ like($@, qr/no such accessor/, 'failed when creating a rel with invalid key, ok' eval { $artist->add_relationship( tracks => 'DBICTest::Track' ); }; -like($@, qr/no join condition/, 'failed when creating a rel without join condition, ok'); +like($@, qr/join condition/, 'failed when creating a rel without join condition, ok');