This project is archived and is in readonly mode.
Several join records are created when using nested_attributes in HABTM
Reported by Antonio Tapiador | December 15th, 2009 @ 03:57 PM | in 2.3.6
When creating a new instance using nested attributes, several records in the join table are created.
Attached a test that proves the bug for HasAndBelongsToMany association. The bug has been also detected in has_many :through associations.
Bug was introduced in commit 6b2291f33063b6742cba84f5f64e03de9907c1f8, hence I'm assigning a responsible :-)
Comments and changes to this ticket
-
Antonio Tapiador December 15th, 2009 @ 03:59 PM
- Title changed from Multiple join records when using nested_attributes in HABTM to Several join records are created when using nested_attributes in HABTM
-
Eloy Duran December 28th, 2009 @ 04:10 PM
- State changed from new to verified
- Milestone set to 2.3.6
Should be in upstream repo in the next few days I expect: http://github.com/Fingertips/rails/commit/146a7505680cbb646c0b9d55d...
-
Repository December 28th, 2009 @ 08:29 PM
- State changed from verified to resolved
(from [146a7505680cbb646c0b9d55dca7cc8494b36e47]) Make sure to not add autosave callbacks multiple times. [#3575 state:resolved]
This makes sure that, in a HABTM association, only one join record is craeted.
http://github.com/rails/rails/commit/146a7505680cbb646c0b9d55dca7cc... -
Repository December 28th, 2009 @ 08:52 PM
(from [9c771a9608f54ebdfcb6fca819c83038489ce50d]) Make sure to not add autosave callbacks multiple times. [#3575 state:resolved]
This makes sure that, in a HABTM association, only one join record is craeted.
http://github.com/rails/rails/commit/9c771a9608f54ebdfcb6fca819c830... -
Jeff Kreeftmeijer November 7th, 2010 @ 04:55 PM
- Tag cleared.
- Importance changed from to Low
Automatic cleanup of spam.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 3575 Several join records are created when using nested_attributes in HABTM (from [146a7505680cbb646c0b9d55dca7cc8494b36e47]) Make su...
- 3575 Several join records are created when using nested_attributes in HABTM (from [9c771a9608f54ebdfcb6fca819c83038489ce50d]) Make su...
- 3866 Callbacks being called twice with nested attributes This was already fixed on both master and 2-3-stable bran...
- 3783 Saving object with nested attributes results in duplicates OK, this ticket is a duplicate, the original one: https:/...