pass through $attrs to add_relationship when $cond is undefined
[dbsrgits/DBIx-Class.git] / 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