Re: [CDBI] delete from lookup table

[prev] [thread] [next] [Date index for 2005/10/27]

From: Peter Speltz
Subject: Re: [CDBI] delete from lookup table
Date: 09:22 on 27 Oct 2005
On 10/27/05, WulfDirk.Leuschner@xxxxxxxxxxxxxx.xxx
<WulfDirk.Leuschner@xxxxxxxxxxxxxx.xxx> wrote:
>
>
> > Peter Speltz [peterspeltz@xxxxx.xxx] wrote:
> >  What i have seen a lot is  is the use or "delete_all" on the results
> >  from a search.
> >  $class->search( id =3D> $related_id)->delete_all;
>
> >  and if a "my_method" is a has_many accessor i think you can say;
> >  $self->my_method(id =3D> $id)->delete_all;
>
> Unfortunately this does not work - it returns the mapped objects themselv=
es.
> Thus, using
> this code you end up deleting both the entry in your lookup table *and* t=
he
> the record for
> the mapped object.

I see what you mean now how the mapping messis everything up.
Seems CDBI should have a revove_from* method in this case. Should not
be too hard to write.

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

Re: [CDBI] delete from lookup table
Peter Speltz 19:27 on 26 Oct 2005

Re: [CDBI] delete from lookup table
Bill Moseley 20:47 on 26 Oct 2005

Re: [CDBI] delete from lookup table
Peter Speltz 09:22 on 27 Oct 2005

Re: [CDBI] delete from lookup table
Bill Moseley 12:44 on 27 Oct 2005

Generated at 14:18 on 27 Oct 2005 by mariachi v0.52