[deprecations] Use modelName instead of typeKey

This commit is contained in:
Piotr Sarnacki 2016-01-07 11:06:23 +01:00
parent 4e3a755908
commit a920ae9cd7
4 changed files with 5 additions and 5 deletions

View File

@ -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
});
}

View File

@ -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
});

View File

@ -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',

View File

@ -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." }
]
};