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