aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Zajpt <jzajpt@blueberry.cz>2009-02-11 17:27:38 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2009-02-12 14:31:27 +0100
commit7ed2e6c463071081d9be55b794477adafb1457d3 (patch)
tree8283106d8c35fbfdec79595a00bf95843fc4cbf0
parent1a2a71333f197e98d1cd7fe380d613cbada4446b (diff)
downloadrails-7ed2e6c463071081d9be55b794477adafb1457d3.tar.gz
rails-7ed2e6c463071081d9be55b794477adafb1457d3.tar.bz2
rails-7ed2e6c463071081d9be55b794477adafb1457d3.zip
Adding inflection of databases (usually we wouldn't amend the current defaults, but this seems to obvious) [#1942 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
-rw-r--r--activesupport/lib/active_support/inflections.rb1
-rw-r--r--activesupport/test/inflector_test_cases.rb3
2 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/inflections.rb b/activesupport/lib/active_support/inflections.rb
index b6d276953a..8fb3fa9aa2 100644
--- a/activesupport/lib/active_support/inflections.rb
+++ b/activesupport/lib/active_support/inflections.rb
@@ -42,6 +42,7 @@ module ActiveSupport
inflect.singular(/(vert|ind)ices$/i, '\1ex')
inflect.singular(/(matr)ices$/i, '\1ix')
inflect.singular(/(quiz)zes$/i, '\1')
+ inflect.singular(/(database)s$/i, '\1')
inflect.irregular('person', 'people')
inflect.irregular('man', 'men')
diff --git a/activesupport/test/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb
index 481c3e835c..b7ac467c37 100644
--- a/activesupport/test/inflector_test_cases.rb
+++ b/activesupport/test/inflector_test_cases.rb
@@ -99,7 +99,8 @@ module InflectorTestCases
"prize" => "prizes",
"edge" => "edges",
- "cow" => "kine"
+ "cow" => "kine",
+ "database" => "databases"
}
CamelToUnderscore = {