Skip Menu |

This queue is for tickets about the Class-DBI CPAN distribution.

Report information
The Basics
Id: 6354
Status: new
Priority: 0/
Queue: Class-DBI

People
Owner: Nobody in particular
Requestors: dmaki [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.96
Fixed in: (no value)



Subject: has_a doesn't handle simple Perl data structures in 0.96
until 0.95 you coulod specify hash and array references as a type for has_a(), like this: __PACKAGE__->has_a( foo => 'HASH', inflate => sub { Storable::thaw( pack("h*", shift ) ) }, deflate => sub { unpack ("h*", Storable::nfreeze(shift) ) } ); However, now Class::DBI::Relationship::HasA line 41 does this: return if ref $value and $value->isa($a_class); Which will fail, because while $value is a ref, it's not a blessed reference. Can this be changed to read return if ref $value and UNIERSAL::isa($value, $a_class);
From: DMAKI
Lines 58 and 72 seems to suffer from the same problem
[DMAKI - Tue May 18 18:14:27 2004]: Show quoted text
> until 0.95 you coulod specify hash and array references as a > type for has_a(), like this: > > __PACKAGE__->has_a( foo => 'HASH', > inflate => sub { Storable::thaw( pack("h*", shift ) ) }, > deflate => sub { unpack ("h*", Storable::nfreeze(shift) ) } > );
This was accidental behaviour, which disappeared because it wasn't tested for. If you can put together a test case that shows this in action, I'll gladly add it back. Thanks, Tony