getoutreach / epf

A framework for keeping your Ember.js apps in sync.
http://epf.io
MIT License
369 stars 33 forks source link

Updating sideloaded hasMany relationship on flush #121

Closed benperiton closed 10 years ago

benperiton commented 10 years ago

Is it possible to have relationships updated when flushing changes? For example, if I have an auditing service on the backend that adds a line whenever something changes, can i have these updated when the save is successful?

Example response:

{
product: {
    id: 12,
    name: 'Widget',
    audit_ids: [1,2]
},
audits: [
    {id: 1, timestamp: '12/2/13'},
    {id: 2, timestamp: '12/2/14'}
]
}

The product model seems to update, but the audits relationship doesn't update. (These are sideloaded at the beginning - which works fine)

ghempton commented 10 years ago

Yes, they should definitely update. Can you post more of your code?

benperiton commented 10 years ago

Ah OK, I wasn't sure if it was supported or not. I'll have a play and see what I'm doing wrong.

If I still have no joy I'll chuck some code up.

Thanks!

benperiton commented 10 years ago

So it seems I broke the api at some point yesterday, long day!

Sorry to have troubled you, I'll close this!