I am trying to generate a model and resources using
rails g model AreaOfLaw name
This creates area_of_laws as the plural version, but I want areas_of_law. As suggested in How do I override rails naming conventions? I have added the following to /config/initializers/inflections.rb:
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular 'area of law', 'areas of law'
end
This custom inflection doesn't work when running a generator even though it does work in rails console:
"area of law".pluralize
=> "areas of law"
How can I make this work for generators?