diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-22 09:55:13 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-05-22 09:55:31 -0500 |
commit | d1cab8e5e0aba87e307a387f1b8267e5c41419c6 (patch) | |
tree | 6f3ba4f165e445768e0af76e758c424ea24938d5 /activerecord/lib | |
parent | feaa7b35a0214240eb34780ab51b843571e74904 (diff) | |
download | rails-d1cab8e5e0aba87e307a387f1b8267e5c41419c6.tar.gz rails-d1cab8e5e0aba87e307a387f1b8267e5c41419c6.tar.bz2 rails-d1cab8e5e0aba87e307a387f1b8267e5c41419c6.zip |
remove repeated documentation in CollectionProxy#clear
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_proxy.rb | 26 |
1 files changed, 2 insertions, 24 deletions
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 # => [#<Pet id: 1, name: "Snoop", group: "dogs", person_id: 1>] - # person.pets.clear # => [] - # person.pets.size # => 0 - # - # Pet.find(1) # => #<Pet id: 1, name: "Snoop", group: "dogs", person_id: nil> - # - # If they are associated with <tt>dependent: :destroy</tt> option, it deletes - # them directly from the database. - # - # class Person < ActiveRecord::Base - # has_many :pets, dependent: :destroy - # end - # - # person.pets # => [#<Pet id: 2, name: "Gorby", group: "cats", person_id: 2>] - # 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 |