In ember-data v0.14 (pre beta). You could do simply extend model functionality to add extra api calls, like voting on a post.
// ember-data v0.14
App.Post.reopenClass({
vote: function(post_id) {
return console.log('vote');
}
});
But after ember-data beta, this doesn't work anymore. So i think the best place to put this code is in App.PostAdapter
. But when i tried to extend from App.ApplicationAdapter.extend
it didn't work.
// ember-data beta (doesn't work)
App.PostAdapter = App.ApplicationAdapter.extend({
vote: function(post_id) {
return console.log('vote');
}
});
Any ideas on what am I doing wrong? and if you have a better suggestion on where should I put these kind of calls, I would really appreciate it. Thanks in advance