From 0d22947e00820b4e011775cfb4ede109650db070 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 11 Jun 2013 10:38:57 -0700 Subject: remove evals from the association --- .../lib/active_record/associations/builder/association.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'activerecord/lib/active_record') 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 -- cgit v1.2.3