diff options
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/association.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/builder/association.rb b/activerecord/lib/active_record/associations/builder/association.rb index 6a3658f328..5804cb7fed 100644 --- a/activerecord/lib/active_record/associations/builder/association.rb +++ b/activerecord/lib/active_record/associations/builder/association.rb @@ -117,7 +117,8 @@ module ActiveRecord::Associations::Builder 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 |