From 71b6f76543686a9ffdc3d6f9045de195ce7d7272 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 19 May 2005 19:15:30 +0000 Subject: Fixed the Inflector to underscore strings containing numbers, so Area51Controller becomes area51_controller #1176 [Nicholas Seckar] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1330 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/inflector.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/inflector.rb') diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb index 5d885c62bf..2f2b37f52a 100644 --- a/activesupport/lib/active_support/inflector.rb +++ b/activesupport/lib/active_support/inflector.rb @@ -24,7 +24,7 @@ module Inflector end def underscore(camel_cased_word) - camel_cased_word.to_s.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z])/,'\1_\2').gsub(/([a-z])([A-Z])/,'\1_\2').downcase + camel_cased_word.to_s.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase end def humanize(lower_case_and_underscored_word) -- cgit v1.2.3