dwyl / dwyl/alog

Adding entry_ids to assocs built with `cast_assoc`

Open
#22 0 comments 0 reactions 1 assignee Claimed by @Danwhy View on GitHub
awaiting-review
Dominant language
Elixir
Stars
15
Forks
2
PR merge metrics
No merged PRs in 30d

Description

If we apply the `cast_assoc` function to a changeset, the association is added to the changes, and will be inserted into the database if it doesn't exist.

This can cause a problem for us, as the association will be inserted without an entry id.

To fix this, when adding the `entry_id` on the insert function, we should iterate through the changes, checking if there are any nested changesets, and add `entry_id`s to those too.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.