Fix findRecord to work without passing a snapshot
We use adapter.findRecord to fetch repo by slug. Using it this way was broken with one of the ember-data releases. This commit brings back the old behaviour.
This commit is contained in:
parent
ab0a2af471
commit
5dc64c4937
|
@ -47,5 +47,11 @@ export default ActiveModelAdapter.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
return this._super(...arguments);
|
return this._super(...arguments);
|
||||||
|
},
|
||||||
|
|
||||||
|
// this can be removed once this PR is merged and live:
|
||||||
|
// https://github.com/emberjs/data/pull/4204
|
||||||
|
findRecord(store, type, id, snapshot) {
|
||||||
|
return this.ajax(this.buildURL(type.modelName, id, snapshot, 'findRecord'), 'GET');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -54,5 +54,11 @@ export default RESTAdapter.extend({
|
||||||
pathForType: function(modelName, id) {
|
pathForType: function(modelName, id) {
|
||||||
var underscored = Ember.String.underscore(modelName);
|
var underscored = Ember.String.underscore(modelName);
|
||||||
return id ? underscored : Ember.String.pluralize(underscored);
|
return id ? underscored : Ember.String.pluralize(underscored);
|
||||||
|
},
|
||||||
|
|
||||||
|
// this can be removed once this PR is merged and live:
|
||||||
|
// https://github.com/emberjs/data/pull/4204
|
||||||
|
findRecord(store, type, id, snapshot) {
|
||||||
|
return this.ajax(this.buildURL(type.modelName, id, snapshot, 'findRecord'), 'GET');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user