Skip to content

Instantly share code, notes, and snippets.

@cloke
Created February 8, 2013 18:03
Show Gist options
  • Save cloke/4740763 to your computer and use it in GitHub Desktop.
Save cloke/4740763 to your computer and use it in GitHub Desktop.
#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()
@cloke
Copy link
Author

cloke commented Feb 8, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment