projects
/
dbsrgits/SQL-Translator-2.0-ish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
a4fda2d
)
this is probably a better coercion
Justin Hunter [Tue, 27 Jul 2010 17:25:03 +0000 (10:25 -0700)]
lib/SQL/Translator/Types.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/SQL/Translator/Types.pm
b/lib/SQL/Translator/Types.pm
index
f8eb10c
..
3a6f846
100644
(file)
--- a/
lib/SQL/Translator/Types.pm
+++ b/
lib/SQL/Translator/Types.pm
@@
-42,7
+42,7
@@
class SQL::Translator::Types {
subtype Bit, as Int, where { $_ == 1 || $_ == 0 };
coerce Bit,
from Undef, via { 0 },
- from Str, via { $_ eq '1' ? 1 : 0 };
+ from Str, via { length() ? 1 : 0 };
subtype DBIHandle, as 'DBI::db';