Skip Menu |

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

Report information
The Basics
Id: 4255
Status: resolved
Priority: 0/
Queue: Class-DBI

People
Owner: Nobody in particular
Requestors: mike [...] nachbaur.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.94
Fixed in: (no value)



Subject: Documentation change, and _croak
This patch fixes two problems. One is an instance where $class->croak is used, when $class->_croak should be used; otherwise this error message is never printed properly. The other fix is a documentation change. It isn't obvious when $obj->has_many("name" => ["class" => "field"]) is called that it implies that the ID used for the reference is the same as the table name. It took quite a bit of work for me to track the solution to this down, so a bit of clarification there might be in order. Great module, by the way. I love it!
--- DBI.pm 2003-08-27 06:19:51.000000000 -0700 +++ DBI.pm-new 2003-10-31 16:22:59.000000000 -0800 @@ -948,7 +948,7 @@ my $search_opts = @args % 2 ? pop @args : {}; while (my ($col, $val) = splice @args, 0, 2) { $col = $class->find_column($col) - or $class->croak("$col is not a column of $class"); + or $class->_croak("$col is not a column of $class"); push @cols, $col; push @vals, $class->_deflated_column($col, $val); } @@ -2272,6 +2272,8 @@ =head3 Mapping Music::CD->has_many(styles => [ 'Music::StyleRef' => 'style' ]); + or + Music::CD->has_many(styles => [ 'Music::StyleRef' => 'style' ] => "cdid"); For many-to-many relationships, where we have a lookup table, we can avoid having to set up a helper method to convert our list of cross-references
Show quoted text
> This patch fixes two problems. One is an instance where $class->croak > is used, when $class->_croak should be used; otherwise this error > message is never printed properly.
Thanks for this. It's already been fixed for the new release, however. Show quoted text
> The other fix is a documentation change. It isn't obvious when $obj-
> >has_many("name" => ["class" => "field"]) is called that it implies
> that the ID used for the reference is the same as the table name. > It took quite a bit of work for me to track the solution to this > down, so a bit of clarification there might be in order.
Rather than documenting this, I've changed the way it works to that that argument should virtually never be needed. The final argument to has_many is now only needed if there is no reciprocal has_a() pointing back. Show quoted text
> Great module, by the way. I love it!
Excellent. Thanks, Tony