
destroy! fails (has :n, :through => resource)
Reported by Leon Bogaert | September 8th, 2008 @ 03:47 PM
I've created two models with an many-to-many association between them. Using destroy! on a collection fails with a sql-query.
The ruby code can be found here: http://pastie.org/268371
The error is: table images has no column named car_id (Sqlite3Error) The @text attribute from command contains: DELETE FROM "images" WHERE "cars_images"."car_id" IS ? AND "images"."id" IN ?
Comments and changes to this ticket
-
Leon Bogaert September 8th, 2008 @ 03:48 PM
I've also tried it with mysql and that gave the same error.
-
Leon Bogaert September 10th, 2008 @ 03:22 AM
- Tag set to dataobjects, dm-core, has_and_belongs_to_many
Also a test bases on the example from this page: http://datamapper.org/docs/assoc...
-
Leon Bogaert September 16th, 2008 @ 03:56 PM
- Tag changed from dataobjects, dm-core, has_and_belongs_to_many to dataobjects, dm-core, has_and_belongs_to_many
OK. I checked the specs and noticed that a lot of the manyToMany stuff isn't implemented yet. Is anyone busy developing this?
-
Dan Kubb (dkubb) December 1st, 2008 @ 02:24 AM
- State changed from new to open
- Assigned user changed from Sam Smoot to Dan Kubb (dkubb)
Leon, we are hard at work fixing the current associations code in dkubb/dm-core. There's still alot more work to do since we're basically rewriting alot of DataMapper while writing better specs and docs for it, but we should have it totally resolved in the next month or two.
I will assign this to myself since I'll need to verify the behavior before merging dkubb/dm-core back into the mainline.
-
Dan Kubb (dkubb) December 4th, 2008 @ 03:55 AM
- State changed from open to accepted
-
Dan Kubb (dkubb) May 28th, 2009 @ 03:39 AM
- State changed from accepted to resolved
I can confirm this is resolved with dm-core/next. Attached is a script to demonstrate the fix.
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »