[deprecations] Use modelName instead of typeKey
This commit is contained in:
parent
4e3a755908
commit
a920ae9cd7
|
@ -17,10 +17,10 @@ export default ApplicationAdapter.extend({
|
|||
updateRecord(store, type, record) {
|
||||
var data, id, serializer;
|
||||
data = {};
|
||||
serializer = store.serializerFor(type.typeKey);
|
||||
serializer = store.serializerFor(type.modelName);
|
||||
serializer.serializeIntoHash(data, type, record);
|
||||
id = Ember.get(record, 'id');
|
||||
return this.ajax(this.buildURL(type.typeKey, id, record), "PATCH", {
|
||||
return this.ajax(this.buildURL(type.modelName, id, record), "PATCH", {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ export default ApplicationAdapter.extend({
|
|||
createRecord(store, type, record) {
|
||||
var data, id, serializer;
|
||||
data = {};
|
||||
serializer = store.serializerFor(type.typeKey);
|
||||
serializer = store.serializerFor(type.modelName);
|
||||
serializer.serializeIntoHash(data, type, record, {
|
||||
includeId: true
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@ export default Ember.Object.extend({
|
|||
|
||||
signInForTests(user) {
|
||||
this.set('state', 'signed-in');
|
||||
if ((user.constructor.typeKey != null) !== 'user') {
|
||||
if ((user.constructor.modelName != null) !== 'user') {
|
||||
this.store.push({
|
||||
data: {
|
||||
type: 'user',
|
||||
|
|
|
@ -11,6 +11,7 @@ window.deprecationWorkflow.config = {
|
|||
// internal component's state
|
||||
{ handler: "log", matchMessage: "Usage of `state` is deprecated, use `_state` instead." },
|
||||
{ handler: "log", matchMessage: "RestAdapter#find has been deprecated and renamed to `findRecord`." },
|
||||
{ handler: "log", matchMessage: "Usage of `typeKey` has been deprecated and will be removed in Ember Data 2.0. It has been replaced by `modelName` on the model class." },
|
||||
|
||||
// TODO
|
||||
{ handler: "silence", matchMessage: "Ember.View is deprecated. Consult the Deprecations Guide for a migration strategy." },
|
||||
|
@ -23,6 +24,5 @@ window.deprecationWorkflow.config = {
|
|||
{ handler: "silence", matchMessage: "Using the same function as getter and setter is deprecated." },
|
||||
{ handler: "silence", matchMessage: "Using store.dematerializeRecord() has been deprecated since it was intended for private use only. You should use store.unloadRecord() instead." },
|
||||
{ handler: "silence", matchMessage: "Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead." },
|
||||
{ handler: "silence", matchMessage: "Usage of `typeKey` has been deprecated and will be removed in Ember Data 2.0. It has been replaced by `modelName` on the model class." }
|
||||
]
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user