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

Comments and Trackbacks

Commenting on this entry has been closed.

... but if you're a dirty spambot, feel free to post a comment here anyways.