From: David Kamholz Date: Tue, 1 Nov 2005 19:03:36 +0000 (+0000) Subject: pass through $attrs to add_relationship when $cond is undefined X-Git-Tag: v0.05005~189 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a3c5f6456be8132194dfbb8012da6bcc65acd67;p=dbsrgits%2FDBIx-Class.git pass through $attrs to add_relationship when $cond is undefined --- diff --git a/lib/DBIx/Class/Relationship/BelongsTo.pm b/lib/DBIx/Class/Relationship/BelongsTo.pm index 35e5428..ce74d85 100644 --- a/lib/DBIx/Class/Relationship/BelongsTo.pm +++ b/lib/DBIx/Class/Relationship/BelongsTo.pm @@ -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