Skip to content

Commit

Permalink
r3258@asus: jeremy | 2005-11-21 00:33:59 -0800
Browse files Browse the repository at this point in the history
 Apply [3139] to stable.  Use Kernel.binding rather than binding to allow columns of that name.  Closes #2973.


git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/stable@3140 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jeremy committed Nov 21, 2005
1 parent 4a9847f commit 81f3a92
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN* *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.] * 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] * Correct boolean handling in generated reader methods. #2945 [don.park@gmail.com, Stefan Kaes]
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/callbacks.rb
Expand Up @@ -332,7 +332,7 @@ def callback(method)
when Symbol when Symbol
self.send(callback) self.send(callback)
when String when String
eval(callback, binding) eval(callback, Kernel.binding)
when Proc, Method when Proc, Method
callback.call(self) callback.call(self)
else else
Expand Down
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/validations.rb
Expand Up @@ -254,7 +254,7 @@ def condition_block?(condition)
def evaluate_condition(condition, record) def evaluate_condition(condition, record)
case condition case condition
when Symbol: record.send(condition) when Symbol: record.send(condition)
when String: eval(condition, binding) when String: eval(condition, Kernel.binding)
else else
if condition_block?(condition) if condition_block?(condition)
condition.call(record) condition.call(record)
Expand Down Expand Up @@ -757,7 +757,7 @@ def run_validations(validation_method)
if validation.is_a?(Symbol) if validation.is_a?(Symbol)
self.send(validation) self.send(validation)
elsif validation.is_a?(String) elsif validation.is_a?(String)
eval(validation, binding) eval(validation, Kernel.binding)
elsif validation_block?(validation) elsif validation_block?(validation)
validation.call(self) validation.call(self)
elsif validation_class?(validation, validation_method) elsif validation_class?(validation, validation_method)
Expand Down

0 comments on commit 81f3a92

Please sign in to comment.