Skip to content
Browse files

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
  • Loading branch information...
1 parent 5177333 commit 119155bebbaf02a0f9540e3bcbdec5e4d3efc636 Marcel Molina committed
View
2 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]
View
2 activerecord/lib/active_record/callbacks.rb
@@ -332,7 +332,7 @@ def callback(method)
when Symbol
self.send(callback)
when String
- eval(callback, Kernel.binding)
+ eval(callback, binding)
when Proc, Method
callback.call(self)
else
View
4 activerecord/lib/active_record/validations.rb
@@ -254,7 +254,7 @@ def condition_block?(condition)
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 @@ def run_validations(validation_method)
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)

0 comments on commit 119155b

Please sign in to comment.
Something went wrong with that request. Please try again.