don't use in-place gsub, it breaks on 1.9.2 since the string was a hash key at one point and apparently gets frozen, fixes #4128

git-svn-id: file:///home/svn/framework3/trunk@12308 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2011-04-13 01:48:37 +00:00
parent 05e47166a3
commit 361922c634
1 changed files with 3 additions and 1 deletions

View File

@ -699,7 +699,9 @@ class Host < ActiveRecord::Base
best_match[:os_flavor] ||= ""
if best_match[:os_name]
# Handle cases where the flavor contains the base name
best_match[:os_flavor].gsub!(best_match[:os_name], '')
# Don't use gsub!() here because the string was a hash key in a
# previously life and gets frozen on 1.9.1, see #4128
best_match[:os_flavor] = best_match[:os_flavor].gsub(best_match[:os_name], '')
end
best_match[:os_name] ||= 'Unknown'