Skip to content

Instantly share code, notes, and snippets.

Created February 11, 2013 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/54f9fa49959c593036a8 to your computer and use it in GitHub Desktop.
Save anonymous/54f9fa49959c593036a8 to your computer and use it in GitHub Desktop.
// Error — Uncaught TypeError: Cannot set property 'object' of undefined
App.Adapter = DS.RESTAdapter.extend({
url: "http://api.tripster.im",
serializer: DS.Serializer.extend({
primaryKey: function(type) {
var typeString = type.toString.split(".")[1].underscore();
console.log("test");
return typeString + "_id";
}
})
});
DS.Adapter.registerTransform('object', {
serialize: function(obj) { return obj; },
deserialize: function(obj) { return obj; }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment