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
This ends up returning null- because the line before it fails to retrieve the the related_collection from the relation field- because it doesn't have one.
The seeds feature is awesome! Thank you for your hard work @EdouardDem ! (Do you have a buy me a coffee link?)
I am, however, running into an issue for M2A relations. This might be a feature request if it's known it is unsupported.
The error itself is vague-
But after adding a few console logs-
We see that it tries to call
collection.startsWith
onnull
(targetModel
).Logged in SeedDataMapper.initialize()
This ends up returning null- because the line before it fails to retrieve the the
related_collection
from the relation field- because it doesn't have one.The item field snapshot
The complexity here is that the targetModel of this
item
field has to be one ofone_allowed_collections
which comes fromone_collection_field
.In my seeds example I added
and seeded only one item type and that did end up working perfectly but that shouldn't be a static value. The targetModel could have multiple options.
So this line in data-mapper initialize:
Needs to be dynamic based on the record's
one_collection_field
.Versions:
3.2.3
(latest)11.5.1
(latest)PostgreSQL
The text was updated successfully, but these errors were encountered: