samedi 24 octobre 2015

How to upgrade push and pushMany use from Ember 1.13.x to 2.x?

I'm trying to update from 1.13.x to 2.x and deprecated update all calls to push and pushMany. But with synchronous relationships, I get the error

"Uncaught Error: Assertion Failed: You looked up the 'profile' relationship on a 'tenant' with id 2 but some of the associated records were not loaded."

I'm not understanding this error because the relationship for profile is side-loaded. Here's my json output.

My relationship looks like this...

profile: DS.belongsTo('profile', { async: false })

and I'm loading data in like so...

let tenantData = store.normalize('tenant', response.tenant);
let tenant = store.push(tenantData);

Works great if I set the async to "true" but I don't want to make another call to the API since I already have the data in the main ajax call.




Aucun commentaire:

Enregistrer un commentaire