aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-10-05 19:23:25 +0100
committerJon Leighton <j@jonathanleighton.com>2012-10-12 11:49:13 +0100
commit9e5f7cc62e9ef1e865c6eba28be69e935434f8e6 (patch)
tree3a7ae51ae10359f58854f549d16c08db28c852fd /activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
parent36360e9bb959f226380ee7c660651b27b3a53d18 (diff)
downloadrails-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/lib/active_record/attribute_methods/time_zone_conversion.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
index b9a69cdb0a..f36a5806a9 100644
--- a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
+++ b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
@@ -50,7 +50,7 @@ module ActiveRecord
if (rounded_value != rounded_time) || (!rounded_value && original_time)
write_attribute("#{attr_name}", original_time)
#{attr_name}_will_change!
- @attributes_cache[:"#{attr_name}"] = zoned_time
+ @attributes_cache["#{attr_name}"] = zoned_time
end
end
EOV