diff options
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/callbacks.rb | 2 | ||||
-rwxr-xr-x | 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) |