You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GET /api/prices/1 304 0.451 ms - -
GET /api/prices/2 304 0.361 ms - -
GET /api/prices/3 304 0.297 ms - -
GET /api/accounts/4 304 0.357 ms - -
GET /api/accounts/5 304 0.271 ms - -
GET /api/accounts/7 304 0.488 ms - -
With Ember data 1.13.9 its asking for price rather than prices:
GET /api/products/1 304 3.418 ms - -
GET /api/price/1 404 22.919 ms - 24
GET /api/price/2 404 19.800 ms - 24
GET /api/price/3 404 14.895 ms - 24
All of my other plurals seem to work fine.
I've debugged the issue in my browser and from what I can see it is an issue in the inflector when pluralize is used by the _buildUrl method. In inflector.js in inflect: function (word, typeRules, irregular) there is this.rules.uncountable. And in the uncountable object there is rice: true.
There is a loop in there:
for (rule in this.rules.uncountable) {
if (lowercase.match(rule + "$")) {
return word;
}
}
When the rule hits 'rice' it hits the return and returns price rather than prices to pluralize.
If you need more info from my debugging please let me know, should these preset rules be getting in there? If yes then rice should not effect price.
@bmac This appears to be fixed in 1.13.10 for me, am I right in thinking when you released 1.13.10 because package.json has "ember-inflector": "^1.9.0" the caret will allow the release to have picked up 1.9.1? Thanks for the release btw.
With 1.13.8 I could browse to http://localhost:4200/products/1 in my app.
And CLI would show get calls as:
GET /api/products/1 304 0.672 ms - -
GET /api/prices/1 304 0.451 ms - -
GET /api/prices/2 304 0.361 ms - -
GET /api/prices/3 304 0.297 ms - -
GET /api/accounts/4 304 0.357 ms - -
GET /api/accounts/5 304 0.271 ms - -
GET /api/accounts/7 304 0.488 ms - -
With Ember data 1.13.9 its asking for price rather than prices:
GET /api/products/1 304 3.418 ms - -
GET /api/price/1 404 22.919 ms - 24
GET /api/price/2 404 19.800 ms - 24
GET /api/price/3 404 14.895 ms - 24
All of my other plurals seem to work fine.
I've debugged the issue in my browser and from what I can see it is an issue in the inflector when pluralize is used by the _buildUrl method. In inflector.js in
inflect: function (word, typeRules, irregular)
there is this.rules.uncountable. And in the uncountable object there isrice: true
.There is a loop in there:
When the rule hits 'rice' it hits the return and returns price rather than prices to pluralize.
If you need more info from my debugging please let me know, should these preset rules be getting in there? If yes then rice should not effect price.
The product model:
The price model:
I'm more than happy to debug this to
The text was updated successfully, but these errors were encountered: