[Bast-commits] r5250 -
DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship
groditi at dev.catalyst.perl.org
groditi at dev.catalyst.perl.org
Tue Dec 16 23:27:57 GMT 2008
Author: groditi
Date: 2008-12-16 23:27:57 +0000 (Tue, 16 Dec 2008)
New Revision: 5250
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship/Accessor.pm
Log:
somehow i messed up the merge. this fixes it
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship/Accessor.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship/Accessor.pm 2008-12-16 23:00:15 UTC (rev 5249)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Relationship/Accessor.pm 2008-12-16 23:27:57 UTC (rev 5250)
@@ -18,7 +18,7 @@
my ($class, $rel, $acc_type) = @_;
my %meth;
if ($acc_type eq 'single') {
- my $rel_cond = $class->relationship_info($rel)->{cond};
+ my $rel_info = $class->relationship_info($rel);
$meth{$rel} = sub {
my $self = shift;
if (@_) {
@@ -28,9 +28,11 @@
return $self->{_relationship_data}{$rel};
} else {
my $cond = $self->result_source->resolve_condition(
- $rel_cond, $rel, $self
+ $rel_info->{cond}, $rel, $self
);
- return if grep { not defined } values %$cond;
+ if ($rel_info->{attrs}->{undef_on_null_fk}){
+ return if grep { not defined } values %$cond;
+ }
my $val = $self->find_related($rel, {}, {});
return unless $val;
return $self->{_relationship_data}{$rel} = $val;
More information about the Bast-commits
mailing list