From 119155bebbaf02a0f9540e3bcbdec5e4d3efc636 Mon Sep 17 00:00:00 2001 From: Marcel Molina Date: Mon, 21 Nov 2005 09:34:10 +0000 Subject: [PATCH] Revert [3130]. Behavior of introducing Kernel.binding causes breakage. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3142 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/CHANGELOG | 2 -- activerecord/lib/active_record/callbacks.rb | 2 +- activerecord/lib/active_record/validations.rb | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index c4f3c09e70..041eafe65b 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,7 +1,5 @@ *SVN* -* Use Kernel.binding rather than binding to allow columns of that name. #2973 [arc@uchicago.edu] - * Add tasks to create, drop and rebuild the MySQL and PostgreSQL test databases. [Marcel Molina Jr.] * Correct boolean handling in generated reader methods. #2945 [don.park@gmail.com, Stefan Kaes] diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index d8b088041f..aa3aa2d1a5 100755 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -332,7 +332,7 @@ module ActiveRecord when Symbol self.send(callback) when String - eval(callback, Kernel.binding) + eval(callback, binding) when Proc, Method callback.call(self) else diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index bb5a69941a..b6c9647b78 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -254,7 +254,7 @@ module ActiveRecord def evaluate_condition(condition, record) case condition when Symbol: record.send(condition) - when String: eval(condition, Kernel.binding) + when String: eval(condition, binding) else if condition_block?(condition) condition.call(record) @@ -764,7 +764,7 @@ module ActiveRecord if validation.is_a?(Symbol) self.send(validation) elsif validation.is_a?(String) - eval(validation, Kernel.binding) + eval(validation, binding) elsif validation_block?(validation) validation.call(self) elsif validation_class?(validation, validation_method)