aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/CHANGELOG2
-rw-r--r--activesupport/lib/active_support/inflector.rb1
-rw-r--r--activesupport/test/inflector_test.rb8
3 files changed, 8 insertions, 3 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG
index 792388d2b6..a2528696f4 100644
--- a/activesupport/CHANGELOG
+++ b/activesupport/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed inflection of perspectives and similar words #1045 [thijs@vandervossen.net]
+
* Added Fixnum#even? and Fixnum#odd?
* Fixed problem with classes being required twice. Object#const_missing now uses require_dependency to load files. It used to use require_or_load which would cause models to be loaded twice, which was not good for validations and other class methods #971 [Nicholas Seckar]
diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb
index 0fa6cb6e53..03dd2b092a 100644
--- a/activesupport/lib/active_support/inflector.rb
+++ b/activesupport/lib/active_support/inflector.rb
@@ -81,6 +81,7 @@ module Inflector
[/(s)eries$/i, '\1\2eries'],
[/([^aeiouy]|qu)ies$/i, '\1y'],
[/([lr])ves$/i, '\1f'],
+ [/(tive)s$/i, '\1'],
[/([^f])ves$/i, '\1fe'],
[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '\1\2sis'],
[/([ti])a$/i, '\1um'],
diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb
index ffadb5bd96..fca4072ad9 100644
--- a/activesupport/test/inflector_test.rb
+++ b/activesupport/test/inflector_test.rb
@@ -57,12 +57,14 @@ class InflectorTest < Test::Unit::TestCase
"old_news" => "old_news",
"news" => "news",
- "series" => "series"
+ "series" => "series",
+
+ "perspective" => "perspectives"
}
CamelToUnderscore = {
- "Product" => "product",
- "SpecialGuest" => "special_guest",
+ "Product" => "product",
+ "SpecialGuest" => "special_guest",
"ApplicationController" => "application_controller"
}