2017-06-04 33 views
0

我試圖生成Rails的5.1「狀態」模式,當我運行Rails的生成模型不使用拐點規則

rails generate model status 

我得到

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. 

我加入一個新的規則在配置/初始化/ inflections.rb

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

再次運行命令,我仍然得到錯誤。

我錯過了什麼?

+0

這'generate'線工作,不需要任何拐點,還有別的東西造成這個錯誤。 – Iceman

回答

-3

也許你可以更改名稱是國家的,所以多是美國