HasOne findExistingLinksFor
has improper method signature
#535
Labels
mapper relations
Mapper relations are the ability to define a relationship one Mapper has with another Mapper
Description
The "parent" record on a hasOne/belongsTo relationship doesn't appear to link correctly, even when the child record already exists in the datastore. I think this is due to the
findExistingLinksFor
method defined on theHasOne
relationship class having an improper method signature.Environment
Steps to reproduce
The
HasOne.findExistingLinksFor
method is looking for two arguments:But the
HasMany.findExistingLinksFor
andBelongsTo.findExistingLinksFor
methods both look for two arguments:Best I can tell, this method is only ever called in one place (Line 146 of
Relation.js
), and the arguments passed in match theHasMany
andBelongsTo
method signatures:I forked the repo and tried this locally:
But apparently
this.getRelation()
chokes unless the child record's Mapper was defined before the parent record's Mapper. I think I've taken this about as far as I can at this point, hoping someone with a better working knowledge of the inner mechanisms here can swoop in and help out.The text was updated successfully, but these errors were encountered: