Change plural form of generated model in rails?

前端 未结 3 1962
粉色の甜心
粉色の甜心 2021-02-06 01:28

I\'m using this command:

rails generate model DayOfMonth day:integer

Rails generated the model \"DayOfMonth\" and the table \"day_of_months\".<

3条回答
  •  没有蜡笔的小新
    2021-02-06 02:00

    ActiveSupport::Inflector.inflections do |inflect|
     inflect.irregular 'day of month', 'days of month'
    end
    

    Read: http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html

提交回复
热议问题