Created
February 8, 2013 18:03
-
-
Save cloke/4740763 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
| #Must be defined before you create the application. | |
| DS.RESTAdapter.registerTransform 'array', | |
| deserialize: (value) -> if Ember.isArray value then Em.A(value) else Em.A() | |
| serialize : (value) -> if Ember.isArray value then Em.A(value) else Em.A() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DS.RESTAdapter.registerTransform('array', {
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();
}
}
});