aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/collection_association.rb
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2013-05-13 11:39:09 -0400
committerNeeraj Singh <neerajdotname@gmail.com>2013-05-13 11:39:09 -0400
commit7b24cf0391ed8916bf12781a179b4ac5995e1690 (patch)
tree46769181104f7b92410913beeaf60b9c38e680cc /activerecord/lib/active_record/associations/collection_association.rb
parentd790b50db4b0e605a915b4a4af5f81acae7b6094 (diff)
downloadrails-7b24cf0391ed8916bf12781a179b4ac5995e1690.tar.gz
rails-7b24cf0391ed8916bf12781a179b4ac5995e1690.tar.bz2
rails-7b24cf0391ed8916bf12781a179b4ac5995e1690.zip
emphasize that callbacks are called in destroy_all
Cleaned up rdoc a bit emphasizing that callbacks are called. Also removed the stress on the fact that records are always removed. If callbacks return false then records will not be deleted.
Diffstat (limited to 'activerecord/lib/active_record/associations/collection_association.rb')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index 2a00ac1386..efd7ecb97c 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -237,11 +237,11 @@ module ActiveRecord
end
end
- # Destroy +records+ and remove them from this association calling
- # +before_remove+ and +after_remove+ callbacks.
+ # Deletes the +records+ and removes them from this association calling
+ # +before_remove+ , +after_remove+ , +before_destroy+ and +after_destroy+ callbacks.
#
- # Note that this method will _always_ remove records from the database
- # ignoring the +:dependent+ option.
+ # Note that this method removes records from the database ignoring the
+ # +:dependent+ option.
def destroy(*records)
records = find(records) if records.any? { |record| record.kind_of?(Fixnum) || record.kind_of?(String) }
delete_or_destroy(records, :destroy)