diff options
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/association_collection.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 94af33d777..4218174442 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -271,7 +271,7 @@ module ActiveRecord # * <tt>collection=objects</tt> - replaces the collections content by deleting and adding objects as appropriate. # * <tt>collection_singular_ids=ids</tt> - replace the collection by the objects identified by the primary keys in +ids+ # * <tt>collection.clear</tt> - removes every object from the collection. This destroys the associated objects if they - # are <tt>:dependent</tt>, deletes them directly from the database if they are <tt>:exclusively_dependent</tt>, + # are <tt>:dependent</tt>, deletes them directly from the database if they are <tt>:dependent => :delete_all</tt>, # and sets their foreign keys to NULL otherwise. # * <tt>collection.empty?</tt> - returns true if there are no associated objects. # * <tt>collection.size</tt> - returns the number of associated objects. diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index a66248ff2e..8e249d1b94 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -62,7 +62,7 @@ module ActiveRecord def clear return self if length.zero? # forces load_target if hasn't happened already - if @reflection.options[:exclusively_dependent] + if @reflection.options[:dependent] && @reflection.options[:dependent] == :delete_all destroy_all else delete_all |