diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-06-11 10:33:16 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-06-11 10:33:16 -0700 |
commit | 8777ae1f4ac42dd47c3455cf40c9cf59daad7ca9 (patch) | |
tree | cd586b32fa19b31f0d5a75f13e4d1a5b7d1bc79d /activerecord | |
parent | a63a964a5d1ed02cf0df1b1a33a96ed2a9fa987b (diff) | |
download | rails-8777ae1f4ac42dd47c3455cf40c9cf59daad7ca9.tar.gz rails-8777ae1f4ac42dd47c3455cf40c9cf59daad7ca9.tar.bz2 rails-8777ae1f4ac42dd47c3455cf40c9cf59daad7ca9.zip |
reduce evals in depdendent associations
Diffstat (limited to 'activerecord')
-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 |