EtecMan wrote:> Hi,
>
> I have a m:n relation between two objects ''order'' and
''book'' with the
> fact that one order might contain several books with the same id (e.g.
> book 1 belongs twice to the order 2).
>
> Now I want to delete one example of book 1 from order 2 such that at the
> end, the order 2 has only stored one example of book 1. Unfortunately,
> order.delete book always deletes all books with the corresponding id. Is
> there a way to delete only the first occurring item?
>
> Thanks in advance :-)
You may have some luck by making use of the manual delete methods
such as Order.delete(params[:id])
or Order.delete([1,2,3])
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---