aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_controller/support/inflector.rb1
-rw-r--r--activerecord/CHANGELOG2
-rw-r--r--activerecord/lib/active_record/support/inflector.rb1
-rw-r--r--activerecord/test/inflector_test.rb1
4 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/support/inflector.rb b/actionpack/lib/action_controller/support/inflector.rb
index 05ff4fede9..f78d34348c 100644
--- a/actionpack/lib/action_controller/support/inflector.rb
+++ b/actionpack/lib/action_controller/support/inflector.rb
@@ -48,6 +48,7 @@ module Inflector
def plural_rules #:doc:
[
[/(x|ch|ss)$/, '\1es'], # search, switch, fix, box, process, address
+ [/([^aeiouy]|qu)ies$/, '\1y'],
[/([^aeiouy]|qu)y$/, '\1ies'], # query, ability, agency
[/(?:([^f])fe|([lr])f)$/, '\1\2ves'], # half, safe, wife
[/sis$/, 'ses'], # basis, diagnosis
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 0b0c0048e9..e19c9e23fa 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*CVS*
+* Fixed the Inflector to handle the movie/movies pair correctly #261 [Scott Baron]
+
* Added bind-style variable interpolation for the condition arrays that uses the adapter's quote method [Michael Koziarski]
Before:
diff --git a/activerecord/lib/active_record/support/inflector.rb b/activerecord/lib/active_record/support/inflector.rb
index 05ff4fede9..b41f85188b 100644
--- a/activerecord/lib/active_record/support/inflector.rb
+++ b/activerecord/lib/active_record/support/inflector.rb
@@ -63,6 +63,7 @@ module Inflector
def singular_rules #:doc:
[
[/(x|ch|ss)es$/, '\1'],
+ [/movies$/, 'movie'],
[/([^aeiouy]|qu)ies$/, '\1y'],
[/([lr])ves$/, '\1f'],
[/([^f])ves$/, '\1fe'],
diff --git a/activerecord/test/inflector_test.rb b/activerecord/test/inflector_test.rb
index 4665558e74..e9684fc515 100644
--- a/activerecord/test/inflector_test.rb
+++ b/activerecord/test/inflector_test.rb
@@ -15,6 +15,7 @@ class InflectorTest < Test::Unit::TestCase
"query" => "queries",
"ability" => "abilities",
"agency" => "agencies",
+ "movie" => "movies",
"wife" => "wives",
"safe" => "saves",