This project is archived and is in readonly mode.
Rename _delete to _destroy in nested attributes
Reported by José Valim | July 9th, 2009 @ 09:59 AM | in 2.3.6
When nested attributes was released in 2.3 it came with a small inconsistency. The DSL uses :allow_destroy, the method called in the associated object is :destroy but the trigger is called _delete:
accepts_nested_attributes_for :tasks, :allow_destroy => true
This patch changes _delete to _destroy but adds a deprecation warning. Documentation was also updated.
As already discussed in the mailing list, someone wanted to add a _delete behavior that will actually delete the associated record. So renaming _delete to _destroy now makes room for improvements in the future.
Comments and changes to this ticket
-
iain July 9th, 2009 @ 10:25 AM
+1 the difference between destroy and delete is quite confusing, let's minimize the confusion
-
Eloy Duran July 11th, 2009 @ 12:16 PM
- Assigned user set to Eloy Duran
-
Eloy Duran July 12th, 2009 @ 12:40 PM
- State changed from new to verified
- Milestone changed from 2.x to 2.3.4
I have verified and applied this patch on my branch of 2-3-stable, which Micheal will look at and merge in before 2.3.4.
http://github.com/alloy/rails/commit/6d4637be2adee0caafcfb7d5a98837...
Thanks!
-
Jeremy Kemper September 11th, 2009 @ 11:04 PM
- Milestone changed from 2.3.4 to 2.3.6
[milestone:id#50064 bulk edit command]
-
Repository September 13th, 2009 @ 02:33 AM
- State changed from verified to resolved
(from [11c338735c3f6e9562c4c82ccd8913dd8b7a6a80]) Rename nested attributes delete to destroy to reflect its actual behavior and DSL (:allow_destroy). Deprecation warning added. [#2889 state:resolved] Signed-off-by: Eloy Duran eloy.de.enige@gmail.com
http://github.com/rails/rails/commit/11c338735c3f6e9562c4c82ccd8913... -
Repository September 13th, 2009 @ 02:33 AM
(from [3091252abaafd15bc085f0be2b17829bebb6522c]) Rename nested attributes delete to destroy to reflect its actual behavior and DSL (:allow_destroy). Deprecation warning added. [#2889 state:resolved] Signed-off-by: Eloy Duran eloy.de.enige@gmail.com
http://github.com/rails/rails/commit/3091252abaafd15bc085f0be2b1782... -
Dudley Flanders March 29th, 2010 @ 10:26 PM
The commit missed a couple of comments and examples that still use the old :_delete key.
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
- 2889 Rename _delete to _destroy in nested attributes (from [11c338735c3f6e9562c4c82ccd8913dd8b7a6a80]) Rename ...
- 2889 Rename _delete to _destroy in nested attributes (from [3091252abaafd15bc085f0be2b17829bebb6522c]) Rename ...