You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Talked with @wycats about this. I was trying to embed a hasMany relationship on store commit and it wouldn't allow me to update the relationship on success. The difference between the two is the order. Currently you have to update the relationship before you update the record.
This fails:
createRecord: (store,type,record) ->root=@rootForType(type)
data= {}
data[root] =@toJSON(record, { includeId:true })
posts= []
record.get("posts").forEach (p) ->posts.pushObjectp.toJSON()
data[root]["posts"] = posts
store=App.router.get('store')
@ajax@buildURL(root), "POST", {
data: data
context:thissuccess: (json) -># this order is important@didCreateRecord(store,type,record,json)
record.get('posts').forEach (p) ->store.didUpdateRelationship(p, 'author')
}
## updating the relationship before calling `didCreateRecord` workssuccess: (json) ->record.get('posts').forEach (p) ->store.didUpdateRelationship(p, 'author')
@didCreateRecord(store,type,record,json)
The text was updated successfully, but these errors were encountered:
Talked with @wycats about this. I was trying to embed a hasMany relationship on store commit and it wouldn't allow me to update the relationship on success. The difference between the two is the order. Currently you have to update the relationship before you update the record.
This fails:
The text was updated successfully, but these errors were encountered: