diff options
author | Eloy Duran <eloy.de.enige@gmail.com> | 2010-01-02 00:49:49 +0100 |
---|---|---|
committer | Eloy Duran <eloy.de.enige@gmail.com> | 2010-01-07 13:19:48 +0100 |
commit | f866ced24ac9cdece7801f50ec79cdbe3ff5ad59 (patch) | |
tree | 1f7c3976acf9c3df6921d1eff44c932bba42bbd6 /activerecord/lib/active_record | |
parent | 2171e0a1d13a176db1e9e9dd55242fdb319b526c (diff) | |
download | rails-f866ced24ac9cdece7801f50ec79cdbe3ff5ad59.tar.gz rails-f866ced24ac9cdece7801f50ec79cdbe3ff5ad59.tar.bz2 rails-f866ced24ac9cdece7801f50ec79cdbe3ff5ad59.zip |
Don't use strings for callbacks, as these will be evaled. Rather use symbols, which uses a direct method dispatch.
Patch by Comron Sattari. [#3429 state:resolved]
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/autosave_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index 62cb996b5d..b3e28b9373 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -163,8 +163,8 @@ module ActiveRecord # guards that check if the save or validation methods have already been # defined before actually defining them. def add_autosave_association_callbacks(reflection) - save_method = "autosave_associated_records_for_#{reflection.name}" - validation_method = "validate_associated_records_for_#{reflection.name}" + save_method = :"autosave_associated_records_for_#{reflection.name}" + validation_method = :"validate_associated_records_for_#{reflection.name}" force_validation = (reflection.options[:validate] == true || reflection.options[:autosave] == true) if reflection.collection_association? |