Displaying 1 result from an estimated 1 matches for "clients_contacts".
2006 Nov 04
0
deleting associations
...:contacts
end
class Contact < ActiveRecord::Base
belongs_to :client
end
--------------------------------------------
I have the next data
Table clients
id name
1 John
Table contacts
id email
1 john@yahoo.com.ar
2 john@gmail.com
3 john@aol.com
Table clients_contacts
client_id contact_id
1 1
1 2
1 3
--------------------------------------------
so I have a collection, in example
contacts_to_delete = [1, 3]
and I want to erase the relation between client 1, and contacts 1 and 3
What''s the best way to delet...