aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/associations/association_collection.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb
index e4e5ffd2b3..ba9373ba6a 100644
--- a/activerecord/lib/active_record/associations/association_collection.rb
+++ b/activerecord/lib/active_record/associations/association_collection.rb
@@ -236,7 +236,7 @@ module ActiveRecord
# Removes all records from this association. Returns +self+ so method calls may be chained.
def clear
unless length.zero? # forces load_target if it hasn't happened already
- if @reflection.options[:dependent] && @reflection.options[:dependent] == :destroy
+ if @reflection.options[:dependent] == :destroy
destroy_all
else
delete_all