Skip to content
Browse files

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

Conflicts:
	activerecord/lib/active_record/attribute_methods.rb
  • Loading branch information...
1 parent a620105 commit 6ae08f280910b81f96fec84be5a1a37a3ebc1ece @tenderlove tenderlove committed Jul 2, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/attribute_methods.rb
View
2 activerecord/lib/active_record/attribute_methods.rb
@@ -33,7 +33,7 @@ def initialize_generated_modules # :nodoc:
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 6ae08f2

Please sign in to comment.
Something went wrong with that request. Please try again.