You must pass an array of records to set a hasMany relationship Error

I just upgraded ember from v3.27.0 to v3.28.4 and ember data from 3.27.1 to 3.28.3 and some of my tests are failing with the error: You must pass an array of records to set a hasMany relationship in places that before it worked fine. For example:

                <Input::Icons::ListToggle
                  @list={{@model.campaign.optionalIcons}}
                  @value={{@model.answer.icons}}
                  @onChange={{this.changeIcons}}
                />

in this case model.answer.icons is an ember data has many relation which returns a promise. When I tried to do assign this value to another ember data model like this it fails:

this.model.answer.icons = value;

does anyone have any thoughts about how to fix this? Is this a new behavior of ember and ember data or is it a bug?

In the case where you’re setting it what is value?

this.model.answer.icons = value;

the value is the resolved @model.campaign.optionalIcons

Hmmm that does seems strange. If I was debugging this I’d probably start by putting a breakpoint in and inspecting those objects (this.model.answer.icons and value) to make sure they are what you expect. You could also try using something like:

this.model.answer.icons.pushObjects(value);

to see if that works or gives you any different errors which could point you in the right direction.