aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-07-02 17:44:30 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-07-02 17:44:30 -0700
commit7e6ea012d2a2fce872d01d2ce045a6f136a42ea4 (patch)
tree2d58353c3204b1911f507ae8e9bf38489d01a1ee /activerecord
parent65ec63f4ba011a1b46c6de83853ddc2da21bbc81 (diff)
downloadrails-7e6ea012d2a2fce872d01d2ce045a6f136a42ea4.tar.gz
rails-7e6ea012d2a2fce872d01d2ce045a6f136a42ea4.tar.bz2
rails-7e6ea012d2a2fce872d01d2ce045a6f136a42ea4.zip
freeze the constant value so it isn't duped when used as a hash key
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index 13d7c6b781..2fd2ea896b 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -23,7 +23,7 @@ module ActiveRecord
def self.set_name_cache(name, value)
const_name = "ATTR_#{name}"
unless const_defined? const_name
- const_set const_name, value
+ const_set const_name, value.dup.freeze
end
end
}