在 Ember 数据 0.13 中,复数定义如下:
DS.RESTAdapter.configure("plurals", {
category: "categories"
});
Configure 不再存在,因此需要另一种方式来定义复数。
神奇的是,似乎如果我通过“return this.store.find('category');”进行查找,JSON 调用包含/categories 而不是/categorys,尽管我根本没有指定类别的复数是分类...
Ember 数据如何确定这一点?有没有办法覆盖?
谢谢
最佳答案
我在 app.js 中使用以下内容:
var inflector = Ember.Inflector.inflector;
inflector.irregular("patient", "patients");
关于ember.js - Ember 数据 1.0.0 : How does pluralization works?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18561115/