When working with the null pattern classes from Mr. Rabbitson, I discovered this slight ommission that results in getting an undefined, when you're actually wanting a null. That is, even when something is not true, I still want it! It should be entirely backwards compatible with existing code. Perhaps it can it make it into the next version?

Hopefully,

David



--- /usr/share/perl5/DBIx/Class/Relationship/Accessor.pm 2009-03-10 17:19:39.000000000 -0700 +++ DBIx/Class/Relationship/Accessor.pm 2009-03-10 17:13:52.000000000 -0700
@@ -25,7 +25,7 @@
        return $self->{_relationship_data}{$rel};
      } else {
        my $val = $self->find_related($rel, {}, {});
-        return unless $val;
+        return $val unless $val;
        return $self->{_relationship_data}{$rel} = $val;
      }
    };





_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to