Re: [CDBI] delete from lookup table
[prev]
[thread]
[next]
[Date index for 2005/10/27]
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