Created
November 26, 2014 20:17
-
-
Save wecc/3d30c73b5bec4fe3d708 to your computer and use it in GitHub Desktop.
Use this method to restore the old Ember Data behavior where properties with missing keys in the payload gets cleared.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| App.ApplicationSerializer = DS.RESTSerializer.extend({ | |
| normalizeAttributes: function(type, hash) { | |
| this._super(type, hash); | |
| type.eachAttribute(function(key) { | |
| if (!hash.hasOwnProperty(key)) { | |
| hash[key] = null; | |
| } | |
| }, this); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment