Skip to content

Instantly share code, notes, and snippets.

@Samsinite
Created January 26, 2015 04:47
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Samsinite/b775f3f0ce1a02a37424 to your computer and use it in GitHub Desktop.
Save Samsinite/b775f3f0ce1a02a37424 to your computer and use it in GitHub Desktop.
Array transform for ember-data
import Ember from 'ember';
import DS from 'ember-data';
export default DS.Transform.extend({
serialize: function(deserialized) {
return !!deserialized ? deserialized.toArray() : null;
},
deserialize: function(serialized) {
return Ember.A(serialized);
}
});
@vasilakisfil
Copy link

Thanks!

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