简体   繁体   中英

Rails Generate Model not using inflection rule

I'm trying to generate a 'Status' model in Rails 5.1 and when I run

rails generate model status

I get

The model name 's' was recognized as a plural, using the singular '' instead. Override with --force-plural or setup custom inflection rules for this noun before running the generator.

I then added a new rule in config/initializers/inflections.rb

ActiveSupport::Inflector.inflections(:en) do |inflect|
  inflect.irregular 'status', 'statuses'
end

ran the command again and I still get the error.

What am I missing?

也许您可以将名称更改为州,所以复数为州

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM