aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/inflector.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-13 07:44:20 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-13 07:44:20 +0000
commit426fa08cc03b5dc65915a648c26a1b139314d54e (patch)
treebffa03bea26a612cb91779d98b701c6ee6f9ed0b /activesupport/lib/active_support/inflector.rb
parenta65835968e55d6963bb3562f331a00c467e56d96 (diff)
downloadrails-426fa08cc03b5dc65915a648c26a1b139314d54e.tar.gz
rails-426fa08cc03b5dc65915a648c26a1b139314d54e.tar.bz2
rails-426fa08cc03b5dc65915a648c26a1b139314d54e.zip
Fixed Inflector.underscore for use with acronyms, so HTML becomes html instead of htm_l #2173 [k@v2studio.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2227 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/inflector.rb')
-rw-r--r--activesupport/lib/active_support/inflector.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb
index 087c883b0b..281ea3f4b9 100644
--- a/activesupport/lib/active_support/inflector.rb
+++ b/activesupport/lib/active_support/inflector.rb
@@ -114,7 +114,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\d])([A-Z])/,'\1_\2').downcase
+ camel_cased_word.to_s.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').gsub(/([a-z\d])([A-Z])/,'\1_\2').downcase
end
def humanize(lower_case_and_underscored_word)