[Bast-commits] r8329 - in trunk/DBIx-Class-EncodedColumn:
lib/DBIx/Class t
frew at dev.catalyst.perl.org
frew at dev.catalyst.perl.org
Fri Jan 15 18:29:51 GMT 2010
Author: frew
Date: 2010-01-15 18:29:50 +0000 (Fri, 15 Jan 2010)
New Revision: 8329
Modified:
trunk/DBIx-Class-EncodedColumn/lib/DBIx/Class/EncodedColumn.pm
trunk/DBIx-Class-EncodedColumn/t/02digest.t
Log:
Don't encode undefs
Modified: trunk/DBIx-Class-EncodedColumn/lib/DBIx/Class/EncodedColumn.pm
===================================================================
--- trunk/DBIx-Class-EncodedColumn/lib/DBIx/Class/EncodedColumn.pm 2010-01-15 18:21:20 UTC (rev 8328)
+++ trunk/DBIx-Class-EncodedColumn/lib/DBIx/Class/EncodedColumn.pm 2010-01-15 18:29:50 UTC (rev 8329)
@@ -9,7 +9,7 @@
__PACKAGE__->mk_classdata( _column_encoders => {} );
-our $VERSION = '0.00005';
+our $VERSION = '0.00006';
sub register_column {
my $self = shift;
@@ -44,6 +44,7 @@
sub set_column {
my $self = shift;
+ return $self->next::method(@_) unless defined $_[1];
my $encs = $self->_column_encoders;
if(exists $encs->{$_[0]} && defined(my $encoder = $encs->{$_[0]})){
return $self->next::method($_[0], $encoder->($_[1]));
Modified: trunk/DBIx-Class-EncodedColumn/t/02digest.t
===================================================================
--- trunk/DBIx-Class-EncodedColumn/t/02digest.t 2010-01-15 18:21:20 UTC (rev 8328)
+++ trunk/DBIx-Class-EncodedColumn/t/02digest.t 2010-01-15 18:29:50 UTC (rev 8329)
@@ -19,7 +19,7 @@
}
my $tests = 5;
-$tests += 21 if $sha_ok;
+$tests += 22 if $sha_ok;
$tests += 6 if $bcrypt_ok;
$tests += 6 if $pgp_ok;
$tests += 7 if $whirlpool_ok;
@@ -217,6 +217,12 @@
}
+if( $sha_ok ){
+ $row->sha1_hex(undef);
+ $row->update;
+ is($row->sha1_hex, undef, 'Check undef is passed through');
+}
+
END {
# In the END section so that the test DB file gets closed before we attempt to unlink it
DigestTest::clear($schema);
More information about the Bast-commits
mailing list