diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-10-05 19:23:25 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-10-12 11:49:13 +0100 |
commit | 9e5f7cc62e9ef1e865c6eba28be69e935434f8e6 (patch) | |
tree | 3a7ae51ae10359f58854f549d16c08db28c852fd /activerecord/test | |
parent | 36360e9bb959f226380ee7c660651b27b3a53d18 (diff) | |
download | rails-9e5f7cc62e9ef1e865c6eba28be69e935434f8e6.tar.gz rails-9e5f7cc62e9ef1e865c6eba28be69e935434f8e6.tar.bz2 rails-9e5f7cc62e9ef1e865c6eba28be69e935434f8e6.zip |
Revert "Key the attributes hash with symbols"
This reverts commit 86c3dfbd47cb96af02daaa655963292b1a1b110e.
Conflicts:
activerecord/lib/active_record/attribute_methods/read.rb
Reason: whilst this increased performance, it also presents a DoS risk
via memory exhaustion if users were allowing user input to dictate the
arguments of read/write_attribute. I will investigate alternative ways
to cut down on string allocations here.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index d08b157011..c2b58fd7d1 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -542,10 +542,10 @@ class AttributeMethodsTest < ActiveRecord::TestCase val = t.send attr_name unless attr_name == "type" if attribute_gets_cached assert cached_columns.include?(attr_name) - assert_equal val, cache[attr_name.to_sym] + assert_equal val, cache[attr_name] else assert uncached_columns.include?(attr_name) - assert !cache.include?(attr_name.to_sym) + assert !cache.include?(attr_name) end end end |