Displaying 1 result from an estimated 1 matches for "point_of_contacts".
Did you mean:
point_of_contact
2006 Feb 10
0
Update two models that have belongs_to relationship
...user
@point_of_contact.updated_by = current_user
@program.pointOfContact = @point_of_contact
@program.save!
This does not work and gives the error:
Violation of PRIMARY KEY constraint ''PK__point_of_contact__1F2E9E6D''.
Cannot insert duplicate key in object ''point_of_contacts'' ......
Doing update_attributes on individual model works but that is two calls?
Is there a better way to do it?
--Jeet
--
Posted via http://www.ruby-forum.com/.