此问题源于:How to link form after creating rails join table
我正在我的产品模型和类别模型之间创建联接表。
连接表应该命名为什么? categories_products 或category_products 还是其他?
最佳答案
类别_产品
。均为复数。按词汇顺序排列。
Quote :
Unless the name of the join table is explicitly specified by using the :join_table option, Active Record creates the name by using the lexical order of the class names. So a join between customer and order models will give the default join table name of “customers_orders” because “c” outranks “o” in lexical ordering.
关于ruby-on-rails - Rails 连接表命名约定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11590469/