From 03402d206ae1d1977e5283173ecb43a88aacead0 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Sun, 20 May 2012 16:11:52 -0500 Subject: update CollectionProxy#destroy_all documentation --- .../lib/active_record/associations/collection_proxy.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index 647d495d56..21c5e3fc5a 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -221,18 +221,26 @@ module ActiveRecord ## # :method: destroy_all - # Destroy all the records from this association. + # Deletes the records of the collection directly from the database. # # class Person < ActiveRecord::Base # has_many :pets # end # # person.pets.size # => 3 + # person.pets + # # => [ + # # #, + # # #, + # # # + # # ] # # person.pets.destroy_all # # person.pets.size # => 0 # person.pets # => [] + # + # Pet.find(1) # => Couldn't find Pet with id=1 ## # :method: empty? -- cgit v1.2.3