[CDBI] Bad things will happen

Kate Yoak kate at yoak.com
Tue Sep 13 07:39:41 BST 2005

If you try to use a has_many relationship with a class that has a
multi-column primary key - bad things will happen.

Specifically, in Class::DBI::Relationship::HasMany

59              return (
60                      before_delete => sub {
$self->foreign_class->search($self->args->{foreign_key} => shift->id)
62                                      ->delete_all;
63:                     });

Terrible things will happen if shift->id returns an array.
I don't think this particular one is in the docs.

Hey... I had fun anyway.  (Yes, I know I deserved it.)

More information about the ClassDBI mailing list