data
data copied to clipboard
unhelpful error in tests if dev forgets to apply polymorphic flag
Error when serializing a model:
You looked up the <name> belongsTo relationship for {type: model-name...} but that relationship is a hasMany.
Happens when the hasMany end of the relationship does not specify polymorphic
and the belongsTo end is polymorphic. Happens during construction of the snapshot of the polymorphic model by the looks of it.
Fix is to specify polymorphic
on the hasMany, but the error message doesn't send you in that direction.
Interestingly the test only fails if it's not the first one to run, so it fails on every other test run as failed tests run first. Very confusing!
same for me