From: Peter Rabbitson Date: Wed, 28 Apr 2010 12:39:02 +0000 (+0000) Subject: Fix failing test and some warnings X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=de0ed7f1a05646ecf440d62d1423eaa46f5cd26b;p=dbsrgits%2FDBIx-Class-Historic.git Fix failing test and some warnings --- diff --git a/lib/DBIx/Class/CDBICompat/ColumnCase.pm b/lib/DBIx/Class/CDBICompat/ColumnCase.pm index eb4b0c0..13bec9c 100644 --- a/lib/DBIx/Class/CDBICompat/ColumnCase.pm +++ b/lib/DBIx/Class/CDBICompat/ColumnCase.pm @@ -25,9 +25,15 @@ sub has_a { sub has_many { my ($class, $rel, $f_class, $f_key, @rest) = @_; - return $class->next::method($rel, $f_class, ( ref($f_key) ? - $f_key : - lc($f_key) ), @rest); + return $class->next::method( + $rel, + $f_class, + (ref($f_key) ? + $f_key : + lc($f_key||'') + ), + @rest + ); } sub get_inflated_column { diff --git a/t/cdbi/columns_as_hashes.t b/t/cdbi/columns_as_hashes.t index 9ae1976..78066b2 100644 --- a/t/cdbi/columns_as_hashes.t +++ b/t/cdbi/columns_as_hashes.t @@ -26,7 +26,7 @@ local $ENV{DBIC_CDBICOMPAT_HASH_WARN} = 0; my $rating = $waves->{rating}; $waves->Rating("PG"); is $rating, "R", 'evaluation of column value is not deferred'; - } qr{^Column 'rating' of 'Film/$waves' was fetched as a hash at \Q$0}; + } qr{^Column 'rating' of 'Film/$waves' was fetched as a hash at\b}; warnings_like { is $waves->{title}, $waves->Title, "columns can be accessed as hashes";