型号名称' WTA'被认为是复数,使用单数' Wtum'代替

时间:2016-12-17 10:46:00

标签: ruby-on-rails model naming-conventions

我为Wta(女子网球协会)制作了一个模型,这就是发生的事情:

asarluhi@home:~/workspace/tennis_project $ rails generate model Wta ranking:integer name:string points:integer
Running via Spring preloader in process 8875
[WARNING] The model name 'Wta' was recognized as a plural, using the singular 'Wtum' instead. Override with --force-plural or setup custom inflection rules for this noun before running the generator.
      invoke  active_record
      create    db/migrate/20161217102926_create_wta.rb
      create    app/models/wtum.rb
      invoke    test_unit
      create      test/models/wtum_test.rb
      create      test/fixtures/wta.yml

因此,在没有提示我选择的情况下,rails解决了将Wta单一化为Wtum的问题:这太可怕了!
我现在还有哪些选择:更改所有这些文件和内部代码或手动删除它们并使用选项--force-plural重新生成模型?

0 个答案:

没有答案