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
Now, if I pass store.findAll('artist') to the dropdown, and try to update it, we will get the following:
Assertion Failed: You must pass an array of records to set a hasMany relationship
How can I make it work if I want to update a relationship on an object instead of just a value? Preferably what I would want in this example is to either overwrite the list entirely by the selected dropdow, or append to it.
The text was updated successfully, but these errors were encountered:
Let's say that a user should choose his favorite artist, yet, we're not going to use the name but rather a reference to another artist.
So, we have
// models/artist.js
export default Model.extend({
name: attr('string')
})
// models/user.js
export default Model.extend({
artists: hasMany('artist', { embedded: 'always', async: true })
});
Now, if I pass store.findAll('artist') to the dropdown, and try to update it, we will get the following:
Assertion Failed: You must pass an array of records to set a hasMany relationship
How can I make it work if I want to update a relationship on an object instead of just a value? Preferably what I would want in this example is to either overwrite the list entirely by the selected dropdow, or append to it.
The text was updated successfully, but these errors were encountered: