From d1cab8e5e0aba87e307a387f1b8267e5c41419c6 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Tue, 22 May 2012 09:55:13 -0500 Subject: remove repeated documentation in CollectionProxy#clear --- .../active_record/associations/collection_proxy.rb | 26 ++-------------------- 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index 468bf5c2f8..9ee69157b3 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -578,30 +578,8 @@ module ActiveRecord alias_method :push, :<< # Equivalent to +delete_all+. The difference is that returns +self+, instead - # of an array with the deleted objects, so methods can be chained. - # - # class Person < ActiveRecord::Base - # has_many :pets - # end - # - # person.pets # => [#] - # person.pets.clear # => [] - # person.pets.size # => 0 - # - # Pet.find(1) # => # - # - # If they are associated with dependent: :destroy option, it deletes - # them directly from the database. - # - # class Person < ActiveRecord::Base - # has_many :pets, dependent: :destroy - # end - # - # person.pets # => [#] - # person.pets.clear # => [] - # person.pets.size # => 0 - # - # Pet.find(2) # => ActiveRecord::RecordNotFound: Couldn't find Pet with id=2 + # of an array with the deleted objects, so methods can be chained. See + # +delete_all+ for more information. def clear delete_all self -- cgit v1.2.3