#463 ✓resolved
ajoseph

Failing to delete a one_to_many relationship entry

Reported by ajoseph | July 16th, 2008 @ 08:01 PM

I have a user with multiple addresses (has n relationship) and I am trying to delete one of the addresses like below:

user.addresses.delete_at(0)

user.save

DM is not issuing the SQL to delete the address even though it removes the address from the collection. (The SQL to update the user object is being issued since I am using dm-timestamps).

I am using DM edge as of 07/16 and Mysql 5.x

Comments and changes to this ticket

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) July 17th, 2008 @ 01:51 AM

    • State changed from “new” to “open”

    ajoseph: If you could provide a failing spec showing this problem I'd be happy to look into it asap.

  • ajoseph

    ajoseph July 21st, 2008 @ 12:57 PM

    Please go ahead and close this ticket.

    Operator error. An SQL UPDATE is being issued to null the parent id in the child record.

    I just need to figure out a way for DM to issue a SQL delete for the child record because I have foriegn key constraints which will not allow the parent id in the child record to be set to null.

  • Bernerd Schaefer

    Bernerd Schaefer July 23rd, 2008 @ 09:54 AM

    • State changed from “open” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Pages