From 00f08793677a164bd728a6576e20241697e61c35 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 17 Mar 2011 10:26:11 -0700 Subject: dup strings on return so that in place modifications do not break anything. I am looking at you "compute_table_name" --- activemodel/lib/active_model/attribute_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel/lib') 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 -- cgit v1.2.3