Ruby on Rails: Override singularize, pluralize.
By kenglish
It took me a while to figure this out but it’s really a no brainer.
I was getting:
>> "biodatabases".singularize => "biodatabasis"
To fix this, I edited config/initializers/inflections.rb and added:
ActiveSupport::Inflector.inflections do |inflect| inflect.irregular 'biodatabase', 'biodatabases' end
I know this is in the docs somewhere but I put in on my blog so I don’t forget.



March 27th, 2009