diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-21 08:34:50 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-21 08:34:50 +0000 |
commit | 5177333e70cbb454679041b939fd074f166a38b8 (patch) | |
tree | 836f529e87485433105da44d7a3f65af2e4e4060 /activerecord/lib/active_record | |
parent | ede2a222ee9412f1f6e671470edc3c18449bbe45 (diff) | |
download | rails-5177333e70cbb454679041b939fd074f166a38b8.tar.gz rails-5177333e70cbb454679041b939fd074f166a38b8.tar.bz2 rails-5177333e70cbb454679041b939fd074f166a38b8.zip |
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
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-x | activerecord/lib/active_record/callbacks.rb | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index aa3aa2d1a5..d8b088041f 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, binding) + eval(callback, Kernel.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 b6c9647b78..bb5a69941a 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, 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) |