-
-
Save MrSchMax/9dab5bbdc00fea73c592 to your computer and use it in GitHub Desktop.
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
/* | |
DS.attr('object') | |
*/ | |
App.ObjectTransform = DS.Transform.extend({ | |
deserialize: function(value) { | |
if (!$.isPlainObject(value)) { | |
return {}; | |
} else { | |
return value; | |
} | |
}, | |
serialize: function(value) { | |
if (!$.isPlainObject(value)) { | |
return {}; | |
} else { | |
return value; | |
} | |
} | |
}); | |
/* | |
DS.attr('array') | |
*/ | |
App.ArrayTransform = DS.Transform.extend({ | |
deserialize: function(value) { | |
if (Ember.isArray(value)) { | |
return Em.A(value); | |
} else { | |
return Em.A(); | |
} | |
}, | |
serialize: function(value) { | |
if (Ember.isArray(value)) { | |
return Em.A(value); | |
} else { | |
return Em.A(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment