1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use Kernel.binding rather than binding to allow columns of that name. References #2973.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3139 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2005-11-21 08:34:50 +00:00
parent ede2a222ee
commit 5177333e70
3 changed files with 5 additions and 3 deletions

View file

@ -1,5 +1,7 @@
*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 file

@ -332,7 +332,7 @@ module ActiveRecord
when Symbol
self.send(callback)
when String
eval(callback, binding)
eval(callback, Kernel.binding)
when Proc, Method
callback.call(self)
else

View file

@ -254,7 +254,7 @@ module ActiveRecord
def evaluate_condition(condition, record)
case condition
when Symbol: record.send(condition)
when String: eval(condition, binding)
when String: eval(condition, Kernel.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, binding)
eval(validation, Kernel.binding)
elsif validation_block?(validation)
validation.call(self)
elsif validation_class?(validation, validation_method)