diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-06-03 00:30:54 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-06-03 00:30:54 -0300 |
commit | 814a994e1bfbb1a3a9cc94103e665ea90fafe792 (patch) | |
tree | 233e4064ee3de4ceea0265c607e7771998f9c7a5 /activerecord | |
parent | 8193a09a1f0f15c4b7624d6c24e8a779baa64d39 (diff) | |
parent | efa1648f282f3844656e5a89ea2207934bcb1130 (diff) | |
download | rails-814a994e1bfbb1a3a9cc94103e665ea90fafe792.tar.gz rails-814a994e1bfbb1a3a9cc94103e665ea90fafe792.tar.bz2 rails-814a994e1bfbb1a3a9cc94103e665ea90fafe792.zip |
Merge pull request #20421 from repinel/fix-clear-guides-and-related-api-docs
[ci skip] fix the `collection.clear` guide
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_proxy.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index 685c3a5f17..ddeafb40ea 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -470,15 +470,16 @@ module ActiveRecord @association.destroy_all end - # Deletes the +records+ supplied and removes them from the collection. For - # +has_many+ associations, the deletion is done according to the strategy - # specified by the <tt>:dependent</tt> option. Returns an array with the + # Deletes the +records+ supplied from the collection according to the strategy + # specified by the +:dependent+ option. If no +:dependent+ option is given, + # then it will follow the default strategy. Returns an array with the # deleted records. # - # If no <tt>:dependent</tt> option is given, then it will follow the default - # strategy. The default strategy is <tt>:nullify</tt>. This sets the foreign - # keys to <tt>NULL</tt>. For, +has_many+ <tt>:through</tt>, the default - # strategy is +delete_all+. + # For +has_many :through+ associations, the default deletion strategy is + # +:delete_all+. + # + # For +has_many+ associations, the default deletion strategy is +:nullify+. + # This sets the foreign keys to +NULL+. # # class Person < ActiveRecord::Base # has_many :pets # dependent: :nullify option by default |