Subject: | Can't store false values in MIghtHave |
This line in MightHave.pm:
my $val = shift or return; # just fetching
prevents a false or undef value from creating a might_have linked
record. I tried to set a score to '0' but no record was created.
Also @extra seems not to be used anymore (although if
$meta->foreign_class can return () then I'm wrong)
Patch forthcoming
--- Class-DBI-v3.0.12/t/14-might_have.t 2005-12-01 15:00:16.638877760 +0100
+++ Class-DBI-v3.0.12.orig/t/14-might_have.t 2005-12-01 14:31:11.622160624 +0100
@@ -3,7 +3,7 @@
BEGIN {
eval "use DBD::SQLite";
- plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 21);
+ plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 18);
}
use lib 't/testlib';
@@ -61,16 +61,4 @@
}
-Film->create_test_film;
-{
- ok my $bt = Film->retrieve('Bad Taste'), "Get Film (recreated)";
- is $bt->blurb, undef, "Bad taste has no blurb";
-
- $bt->blurb("0");
- $bt->update;
- is $bt->blurb, "0", "We can write false values";
-
- $bt->delete;
-}
-