This is a bug in activesupport/lib/active_support/inflections.rb

Somehow the singular form is included as a plural form, immediately
after the plural, so what happens in the Inflector.pluralize method
call is
queries.pluralize -> query -> queries

Anyway it's a trivial fix:

Index: ../lib/active_support/inflections.rb
===================================================================
--- ../lib/active_support/inflections.rb        (revision 4867)
+++ ../lib/active_support/inflections.rb        (working copy)
@@ -11,7 +11,6 @@
   inflect.plural(/(?:([^f])fe|([lr])f)$/i, '\1\2ves')
   inflect.plural(/(hive)$/i, '\1s')
   inflect.plural(/([^aeiouy]|qu)y$/i, '\1ies')
-  inflect.plural(/([^aeiouy]|qu)ies$/i, '\1y')
   inflect.plural(/(x|ch|ss|sh)$/i, '\1es')
   inflect.plural(/(matr|vert|ind)ix|ex$/i, '\1ices')
   inflect.plural(/([m|l])ouse$/i, '\1ice')

And a test to prove that the fix, 'fixes' the problem:

Index: inflector_test.rb
===================================================================
--- inflector_test.rb   (revision 4867)
+++ inflector_test.rb   (working copy)
@@ -200,6 +200,10 @@
     "person_street_address" => "person-street-address"
   }

+  def test_strange_pluralize
+    assert_equal "queries", Inflector.pluralize("queries")
+  end
+


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core
-~----------~----~----~----~------~----~------~--~---

Reply via email to