I am stuck in a situation where I shouldn't return id
field in the API endpoint. I need to tell ember to use slug
field for / instead of id
.
I tried DS.RESTAdapter.map('App.Post', id: {key: 'slug'})
. While this works perfectly fine for App.Post.find("a-slug-name")
, It messes up for App.Post.find()
resulting in adding a new model every time it is called. And also assigning id
to null.
So how should I do this.