Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed the Inflector to handle the movie/movies pair correctly #261 [S…

…cott Baron]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@60 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit b4f4d038b9b240c2a388bbe3fbfb885170930f99 1 parent d1856a0
@dhh dhh authored
View
1  actionpack/lib/action_controller/support/inflector.rb
@@ -48,6 +48,7 @@ def foreign_key(class_name, separate_class_name_and_id_with_underscore = true)
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
View
2  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:
View
1  activerecord/lib/active_record/support/inflector.rb
@@ -63,6 +63,7 @@ def plural_rules #:doc:
def singular_rules #:doc:
[
[/(x|ch|ss)es$/, '\1'],
+ [/movies$/, 'movie'],
[/([^aeiouy]|qu)ies$/, '\1y'],
[/([lr])ves$/, '\1f'],
[/([^f])ves$/, '\1fe'],
View
1  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",
Please sign in to comment.
Something went wrong with that request. Please try again.