[CDBI] Bad things will happen

Kate Yoak kate at yoak.com
Tue Sep 13 20:55:24 BST 2005


I apologize for missing the obvious.  It's there of course, as several
people have pointed out to me privately.  Thanks guys for your discretion.

> -----Original Message-----
> From: classdbi-bounces at lists.digitalcraftsmen.net
> [mailto:classdbi-bounces at lists.digitalcraftsmen.net]On Behalf Of Kate
> Yoak
> Sent: Monday, September 12, 2005 11:40 PM
> To: Classdbi
> Subject: [CDBI] Bad things will happen
>
>
> 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 {
> 61:
> $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.)
>
>
>
> _______________________________________________
> ClassDBI mailing list
> ClassDBI at lists.digitalcraftsmen.net
> http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
>






More information about the ClassDBI mailing list