0
votes

In my application I have a model post, it has properties user_likes and user_shares, a user can share and like a post of course...

a save action results in a PUT for /posts/:id with post as payload, but in my webserver shares and likes have different store strategies, and I need know what exactly has changed to save properly, how can I do it with ember?

1

1 Answers

1
votes

The Model class has a changedAttributes method that will tell you what attributes have changed. You can create a PostAdapter and override the updateRecord method to customize the way the data is persisted. Or if it's all going to the same place and you just want to change the JSON format, you can create a PostSerializer and override the serialize method.