aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-03-17 10:26:11 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-03-17 10:26:11 -0700
commit00f08793677a164bd728a6576e20241697e61c35 (patch)
tree04b1f14ef9aa7140fa46a99898aa454386c08481 /activemodel/lib
parentc834a751d2acbd55b580cbba2e96dd29c5d9a452 (diff)
downloadrails-00f08793677a164bd728a6576e20241697e61c35.tar.gz
rails-00f08793677a164bd728a6576e20241697e61c35.tar.bz2
rails-00f08793677a164bd728a6576e20241697e61c35.zip
dup strings on return so that in place modifications do not break anything. I am looking at you "compute_table_name"
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/attribute_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb
index 21ddef6b75..c985eb293b 100644
--- a/activemodel/lib/active_model/attribute_methods.rb
+++ b/activemodel/lib/active_model/attribute_methods.rb
@@ -109,7 +109,7 @@ module ActiveModel
# use eval instead of a block to work around a memory leak in dev
# mode in fcgi
value = value.nil? ? 'nil' : value.to_s
- sing.send(:define_method, name) { value }
+ sing.send(:define_method, name) { value.dup }
end
end