From 98292128492840376064994c561de95aeb0c3be6 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 6 Jan 2008 20:27:56 +0000 Subject: Ruby 1.9 compat: instance_eval binding to get the record binding instead of accidentally getting current Kernel#binding. Closes #10716 [Dirkjan Bussink] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8575 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/validations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 47b7610d4d..98dfcece8b 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -348,7 +348,7 @@ module ActiveRecord def evaluate_condition(condition, record) case condition when Symbol; record.send(condition) - when String; eval(condition, record.send(:binding)) + when String; eval(condition, record.instance_eval { binding }) else if condition_block?(condition) condition.call(record) -- cgit v1.2.3