This project is archived and is in readonly mode.

#2889 ✓resolved
José Valim

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

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

Referenced by

Pages