开发者

Custom Inflections not working on rails3?

开发者 https://www.devze.com 2023-01-21 22:34 出处:网络
I\'m using Rails (3.0.1) and have the following code in initializers/inflections.rb ActiveSupport::Inflector.inflections do |inflect|

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消