diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-06 20:27:56 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-06 20:27:56 +0000 |
commit | 98292128492840376064994c561de95aeb0c3be6 (patch) | |
tree | 0858b3ebbed24e54bb35a6f30e1e922c321a5b86 /activerecord | |
parent | ebe3a0d532152d47f270ffaa0e11b994f4a8b177 (diff) | |
download | rails-98292128492840376064994c561de95aeb0c3be6.tar.gz rails-98292128492840376064994c561de95aeb0c3be6.tar.bz2 rails-98292128492840376064994c561de95aeb0c3be6.zip |
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
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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) |