提交 7e6ea012 编写于 作者: A Aaron Patterson

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

上级 65ec63f4
......@@ -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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册