diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-06-11 10:38:57 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-06-11 10:38:57 -0700 |
commit | 0d22947e00820b4e011775cfb4ede109650db070 (patch) | |
tree | 9065e21aec111556bfc6406662255d817fdbf46c /activerecord/lib | |
parent | 8777ae1f4ac42dd47c3455cf40c9cf59daad7ca9 (diff) | |
download | rails-0d22947e00820b4e011775cfb4ede109650db070.tar.gz rails-0d22947e00820b4e011775cfb4ede109650db070.tar.bz2 rails-0d22947e00820b4e011775cfb4ede109650db070.zip |
remove evals from the association
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/builder/association.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/activerecord/lib/active_record/associations/builder/association.rb b/activerecord/lib/active_record/associations/builder/association.rb index 5804cb7fed..3254da4677 100644 --- a/activerecord/lib/active_record/associations/builder/association.rb +++ b/activerecord/lib/active_record/associations/builder/association.rb @@ -111,14 +111,8 @@ module ActiveRecord::Associations::Builder ) end - mixin.class_eval <<-CODE, __FILE__, __LINE__ + 1 - def #{macro}_dependent_for_#{name} - association(:#{name}).handle_dependency - end - CODE - - method = "#{macro}_dependent_for_#{name}" - model.before_destroy lambda { |o| o.public_send method } + n = name + model.before_destroy lambda { |o| o.association(n).handle_dependency } end def valid_dependent_options |