I'm using Rails (3.0.1) and have the following code in initializers/inflections.rb
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular('nursery', 'nurseries')
end
From the console I'm getting:
"nursery".pluralize => "nurseries"
"nurseries".singularize => "nurseries"
I should be getting:
"nurseries".singularize => "nursery"
Any ideas?
来源:https://stackoverflow.com/questions/4028992/custom-inflections-not-working-on-rails3