From 51448a365b33f57e0805353b40ef07f867ffc253 Mon Sep 17 00:00:00 2001 From: Stanley Stuart Date: Tue, 21 Jul 2015 12:13:07 -0500 Subject: [PATCH] [BUGFIX release] squash normalizePayload deprecations --- packages/ember-data/lib/serializers/json-serializer.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/ember-data/lib/serializers/json-serializer.js b/packages/ember-data/lib/serializers/json-serializer.js index e43c681b9d2..cc474e74051 100644 --- a/packages/ember-data/lib/serializers/json-serializer.js +++ b/packages/ember-data/lib/serializers/json-serializer.js @@ -1468,7 +1468,10 @@ var JSONSerializer = Serializer.extend({ @return {Object} json The deserialized payload */ extractSingle: function(store, typeClass, payload, id, requestType) { - Ember.deprecate('`serializer.normalizePayload` has been deprecated. Please use `serializer.normalizeResponse` with the new Serializer API to modify the payload.', this.normalizePayload === JSONSerializer.prototype.normalizePayload); + if (!this.get('didDeprecateNormalizePayload')) { + this.set('didDeprecateNormalizePayload', true); + Ember.deprecate('`serializer.normalizePayload` has been deprecated. Please use `serializer.normalizeResponse` with the new Serializer API to modify the payload.', this.normalizePayload === JSONSerializer.prototype.normalizePayload); + } var normalizedPayload = this.normalizePayload(payload); return this.normalize(typeClass, normalizedPayload); }, @@ -1500,7 +1503,10 @@ var JSONSerializer = Serializer.extend({ @return {Array} array An array of deserialized objects */ extractArray: function(store, typeClass, arrayPayload, id, requestType) { - Ember.deprecate('`serializer.normalizePayload` has been deprecated. Please use `serializer.normalizeResponse` with the new Serializer API to modify the payload.', this.normalizePayload === JSONSerializer.prototype.normalizePayload); + if (!this.get('didDeprecateNormalizePayload')) { + this.set('didDeprecateNormalizePayload', true); + Ember.deprecate('`serializer.normalizePayload` has been deprecated. Please use `serializer.normalizeResponse` with the new Serializer API to modify the payload.', this.normalizePayload === JSONSerializer.prototype.normalizePayload); + } var normalizedPayload = this.normalizePayload(arrayPayload); var serializer = this;