From: Ash Berlin Date: Thu, 21 Dec 2006 21:04:33 +0000 (+0000) Subject: Made many_to_many throw an exception if its not provided with a $f_rel X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d0ed3b556279e0d36813cb941bad1f656ba49f39;p=dbsrgits%2FDBIx-Class-Historic.git Made many_to_many throw an exception if its not provided with a $f_rel --- diff --git a/lib/DBIx/Class/Relationship/ManyToMany.pm b/lib/DBIx/Class/Relationship/ManyToMany.pm index e294a8c..d8d50de 100644 --- a/lib/DBIx/Class/Relationship/ManyToMany.pm +++ b/lib/DBIx/Class/Relationship/ManyToMany.pm @@ -6,6 +6,15 @@ use warnings; sub many_to_many { my ($class, $meth, $rel, $f_rel, $rel_attrs) = @_; + + $class->throw_exception( + "missing relation in many-to-many" + ) unless $rel; + + $class->throw_exception( + "missing foreign relation in many-to-many" + ) unless $f_rel; + { no strict 'refs'; no warnings 'redefine';