pass through $attrs to add_relationship when $cond is undefined
David Kamholz [Tue, 1 Nov 2005 19:03:36 +0000 (19:03 +0000)]
lib/DBIx/Class/Relationship/BelongsTo.pm

index 35e5428..ce74d85 100644 (file)
@@ -16,7 +16,7 @@ sub belongs_to {
     my $acc_type = ($class->_columns->{$rel}) ? 'filter' : 'single';
     $class->add_relationship($rel, $f_class,
       { "foreign.${pri}" => "self.${rel}" },
-      { accessor => $acc_type }
+      { accessor => $acc_type, %{$attrs || {}} }
     );
   }
   # multiple key relationship