diff --git a/activerecord/lib/active_record/associations/builder/association.rb b/activerecord/lib/active_record/associations/builder/association.rb index 6a3658f3284c5eef1ec48a6a7564318fb69fd048..5804cb7feda12a1b76ba2506ede26720451becc0 100644 --- a/activerecord/lib/active_record/associations/builder/association.rb +++ b/activerecord/lib/active_record/associations/builder/association.rb @@ -117,7 +117,8 @@ def #{macro}_dependent_for_#{name} end CODE - model.before_destroy "#{macro}_dependent_for_#{name}" + method = "#{macro}_dependent_for_#{name}" + model.before_destroy lambda { |o| o.public_send method } end def valid_dependent_options