diff options
author | Xavier Noria <fxn@hashref.com> | 2013-01-21 08:06:26 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2013-01-21 08:06:26 -0800 |
commit | 3f18f73c202644d6422702eb6e5416d7aa06c023 (patch) | |
tree | 81eecb64dd53dd2c605ad8b7c0b16bad1db28962 /activesupport/lib/active_support/inflector | |
parent | c6a39c01f78b406da91314acad26c860c9819804 (diff) | |
parent | ef4ac7a48979f6232591db88599d5ff8ae95b20b (diff) | |
download | rails-3f18f73c202644d6422702eb6e5416d7aa06c023.tar.gz rails-3f18f73c202644d6422702eb6e5416d7aa06c023.tar.bz2 rails-3f18f73c202644d6422702eb6e5416d7aa06c023.zip |
Merge pull request #8671 from xuanxu/fix_irregular
Inflector irregular singularize rules
Diffstat (limited to 'activesupport/lib/active_support/inflector')
-rw-r--r-- | activesupport/lib/active_support/inflector/inflections.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/inflector/inflections.rb b/activesupport/lib/active_support/inflector/inflections.rb index 9cf4b2b2ba..e80efffe82 100644 --- a/activesupport/lib/active_support/inflector/inflections.rb +++ b/activesupport/lib/active_support/inflector/inflections.rb @@ -132,6 +132,7 @@ module ActiveSupport plural(Regexp.new("(#{singular[0,1]})#{singular[1..-1]}$", "i"), '\1' + plural[1..-1]) plural(Regexp.new("(#{plural[0,1]})#{plural[1..-1]}$", "i"), '\1' + plural[1..-1]) singular(Regexp.new("(#{plural[0,1]})#{plural[1..-1]}$", "i"), '\1' + singular[1..-1]) + singular(Regexp.new("(#{singular[0,1]})#{singular[1..-1]}$", "i"), '\1' + singular[1..-1]) else plural(Regexp.new("#{singular[0,1].upcase}(?i)#{singular[1..-1]}$"), plural[0,1].upcase + plural[1..-1]) plural(Regexp.new("#{singular[0,1].downcase}(?i)#{singular[1..-1]}$"), plural[0,1].downcase + plural[1..-1]) @@ -139,6 +140,8 @@ module ActiveSupport plural(Regexp.new("#{plural[0,1].downcase}(?i)#{plural[1..-1]}$"), plural[0,1].downcase + plural[1..-1]) singular(Regexp.new("#{plural[0,1].upcase}(?i)#{plural[1..-1]}$"), singular[0,1].upcase + singular[1..-1]) singular(Regexp.new("#{plural[0,1].downcase}(?i)#{plural[1..-1]}$"), singular[0,1].downcase + singular[1..-1]) + singular(Regexp.new("#{singular[0,1].upcase}(?i)#{singular[1..-1]}$"), singular[0,1].upcase + singular[1..-1]) + singular(Regexp.new("#{singular[0,1].downcase}(?i)#{singular[1..-1]}$"), singular[0,1].downcase + singular[1..-1]) end end |