FEATURE: addPluralization() in the store adapter
This commit is contained in:
parent
0a9e2f54ff
commit
b0e62e4dc1
|
@ -37,10 +37,18 @@ function findAndRemoveMap(type, id) {
|
|||
flushMap();
|
||||
|
||||
export default Ember.Object.extend({
|
||||
plurals: {},
|
||||
pluralize(thing) {
|
||||
if (this.get('plurals')[thing]) {
|
||||
return this.get('plurals')[thing];
|
||||
}
|
||||
return thing + "s";
|
||||
},
|
||||
|
||||
addPluralization(thing, plural) {
|
||||
this.get('plurals')[thing] = plural;
|
||||
},
|
||||
|
||||
findAll(type) {
|
||||
const self = this;
|
||||
return this.adapterFor(type).findAll(this, type).then(function(result) {
|
||||
|
|
Loading…
Reference in New Issue