Permalink
Browse files

freeze the constant value so it isn't duped when used as a hash key

  • Loading branch information...
1 parent 65ec63f commit 7e6ea012d2a2fce872d01d2ce045a6f136a42ea4 @tenderlove tenderlove committed Jul 3, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/attribute_methods.rb
@@ -23,7 +23,7 @@ module AttributeMethods
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
}

0 comments on commit 7e6ea01

Please sign in to comment.