From aacf2581cde0147dc66c3eeacf6d7447c2bbafdf Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Wed, 19 May 2010 16:37:41 -0300 Subject: refactor evals and adds some __FILE__ and __LINE__ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activerecord/lib/active_record/association_preload.rb | 2 +- activerecord/lib/active_record/associations.rb | 4 ++-- activerecord/lib/active_record/base.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/association_preload.rb b/activerecord/lib/active_record/association_preload.rb index 95bbaf00cf..1f5217191c 100644 --- a/activerecord/lib/active_record/association_preload.rb +++ b/activerecord/lib/active_record/association_preload.rb @@ -378,7 +378,7 @@ module ActiveRecord def interpolate_sql_for_preload(sql) - instance_eval("%@#{sql.gsub('@', '\@')}@") + instance_eval("%@#{sql.gsub('@', '\@')}@", __FILE__, __LINE__) end def append_conditions(reflection, preload_options) diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index f23d881c7b..5b0ba86308 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1461,7 +1461,7 @@ module ActiveRecord before_destroy(method_name) module_eval( - "#{reflection.class_name}.send(:attr_readonly,\"#{cache_column}\".intern) if defined?(#{reflection.class_name}) && #{reflection.class_name}.respond_to?(:attr_readonly)" + "#{reflection.class_name}.send(:attr_readonly,\"#{cache_column}\".intern) if defined?(#{reflection.class_name}) && #{reflection.class_name}.respond_to?(:attr_readonly)", __FILE__, __LINE__ ) end @@ -2130,7 +2130,7 @@ module ActiveRecord end def interpolate_sql(sql) - instance_eval("%@#{sql.gsub('@', '\@')}@") + instance_eval("%@#{sql.gsub('@', '\@')}@", __FILE__, __LINE__) end end end diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 1b76f357e3..aa2826fb33 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1786,7 +1786,7 @@ module ActiveRecord #:nodoc: # Interpolate custom SQL string in instance context. # Optional record argument is meant for custom insert_sql. def interpolate_sql(sql, record = nil) - instance_eval("%@#{sql.gsub('@', '\@')}@") + instance_eval("%@#{sql.gsub('@', '\@')}@", __FILE__, __LINE__) end # Instantiates objects for all attribute classes that needs more than one constructor parameter. This is done -- cgit v1.2.3