aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-05-19 16:37:41 -0300
committerJosé Valim <jose.valim@gmail.com>2010-05-20 15:18:57 +0200
commitaacf2581cde0147dc66c3eeacf6d7447c2bbafdf (patch)
treea7f099044c0e8678454af5852a415c757c567c94 /activerecord
parent7f07cc364a7ee7ceae21b29b54467fde0db93389 (diff)
downloadrails-aacf2581cde0147dc66c3eeacf6d7447c2bbafdf.tar.gz
rails-aacf2581cde0147dc66c3eeacf6d7447c2bbafdf.tar.bz2
rails-aacf2581cde0147dc66c3eeacf6d7447c2bbafdf.zip
refactor evals and adds some __FILE__ and __LINE__
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/association_preload.rb2
-rwxr-xr-xactiverecord/lib/active_record/associations.rb4
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
3 files changed, 4 insertions, 4 deletions
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