getting rid of warns about undefined value for accessor
Wallace Reis [Tue, 16 Sep 2008 13:14:20 +0000 (13:14 +0000)]
lib/SQL/Translator/Parser/DBIx/Class.pm

index d4499aa..ef7c51f 100644 (file)
@@ -149,7 +149,8 @@ sub parse {
                 $fk_constraint = $rel_info->{attrs}{is_foreign_key_constraint};
             }
             # it can not be multi
-            elsif ( $rel_info->{attrs}{accessor} eq 'multi' ) {
+            elsif ( $rel_info->{attrs}{accessor}
+                    && $rel_info->{attrs}{accessor} eq 'multi' ) {
                 $fk_constraint = 0;
             }
             # if indeed single, check if all self.columns are our primary keys.