aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorGeorge Millo <georgejulianmillo@gmail.com>2014-12-23 10:18:02 +0000
committerGeorge Millo <georgejulianmillo@gmail.com>2014-12-23 10:18:02 +0000
commit7476b90e164ec62aa4719fa8398fb8464c0e453e (patch)
tree1fb0a0303da1f8be04771be3c56bda52eac01bdb /activerecord
parent0369808917f7a67b6375aaaa34f20d773ae9b339 (diff)
downloadrails-7476b90e164ec62aa4719fa8398fb8464c0e453e.tar.gz
rails-7476b90e164ec62aa4719fa8398fb8464c0e453e.tar.bz2
rails-7476b90e164ec62aa4719fa8398fb8464c0e453e.zip
Add information about "allow_destroy" requiring an ID. [ci skip]
I just wasted an absurd amount of time trying to figure out why my model wasn't being deleted even though I was setting `_destroy` to true like the instructions said. Making the documentation a little bit clear so that someone like me doesn't waste their time in future.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/nested_attributes.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/nested_attributes.rb b/activerecord/lib/active_record/nested_attributes.rb
index 8a2a06f2ca..0f9b52f69f 100644
--- a/activerecord/lib/active_record/nested_attributes.rb
+++ b/activerecord/lib/active_record/nested_attributes.rb
@@ -81,6 +81,9 @@ module ActiveRecord
#
# Note that the model will _not_ be destroyed until the parent is saved.
#
+ # Also note that the model will not be destroyed unless you also specify
+ # its id in the updated hash.
+ #
# === One-to-many
#
# Consider a member that has a number of posts: