Kill the Rails pluralization

Journal entry
February 2, 2006

One of the oft-ranted about features of Rails, is the Inflector - also known as that f***** pluralizer. To turn it off, put this in your config/environment.rb, below the line that says “Include your application configuration below”:

ActiveRecord::Base.pluralize_table_names = false

This works in Rails 1.0, and counters seemingly weird issues where Rails can’t find your tables (like the “Before updating scaffolding from new DB schema, try creating a table for your model” message from the scaffold generator).

To figure out what the pluralizer does and expects, do check out Geoffrey Grosenbach’s Pluralizer Tool.

Categories
Selling out
Did you know?
Jakob is an independent web application developer who builds awesome stuff for the web. You can hire him to build awesome stuff for you.

Comments and Trackbacks

Commenting on this entry has been closed.