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 =
themselves.
>> Thus, using
>> this code you end up deleting both the entry in your lookup table =
*and* the
>> 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.
You are right. I'd propose to wait if some other people come up with =
additional ideas and then ask Tony if he thinks it is worth =
implementing.
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
|
|
Re: [CDBI] delete from lookup table
12:28 on 27 Oct 2005
|