Skip to content
Browse files

update CollectionProxy#destroy_all documentation

  • Loading branch information...
1 parent fa6d921 commit 03402d206ae1d1977e5283173ecb43a88aacead0 Francesco Rodriguez committed May 20, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 activerecord/lib/active_record/associations/collection_proxy.rb
View
10 activerecord/lib/active_record/associations/collection_proxy.rb
@@ -221,18 +221,26 @@ class CollectionProxy < Relation
##
# :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
+ # # => [
+ # # #<Pet id: 1, name: "Fancy-Fancy", person_id: 1>,
+ # # #<Pet id: 2, name: "Spook", person_id: 1>,
+ # # #<Pet id: 3, name: "Choo-Choo", person_id: 1>
+ # # ]
#
# person.pets.destroy_all
#
# person.pets.size # => 0
# person.pets # => []
+ #
+ # Pet.find(1) # => Couldn't find Pet with id=1
##
# :method: empty?

0 comments on commit 03402d2

Please sign in to comment.
Something went wrong with that request. Please try again.