Is there documentation somewhere on how RoR handles pluralization? I''m finding it head-scratching/table-thumping. I''m playing with converting an old PHP app to RoR. I used to have a table called "status_code" which was referenced by column "status". I converted the "status" column to "status_id" and the table to "statuses", but when I let the scripts generate the model, they pluralized it to "status". (I"m not even sure which is ''correct'' in English grammar. I would like to know if there''s a list of the rules that RoR is using, though...) -- joshua
On Tue, 8 Mar 2005 15:23:25 -0600, Joshua Wehner <joshua-AnsgPkSrJBbs2Lz0fTdYFQ@public.gmane.org> wrote:> Is there documentation somewhere on how RoR handles pluralization? I''m > finding it head-scratching/table-thumping.I believe it uses the Inflector.pluralize method (http://rails.rubyonrails.com/classes/Inflector.html#M000667). The actual rules for it are documented at http://rails.rubyonrails.com/classes/Inflector.html#M000677. Override table_name in your models if you need to customize the table name that RoR tries. -- rick http://techno-weenie.net