dwyl / dwyl/alog

Improve update function

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Elixir
Stars
15
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Currently we've had to override the update function for a few of our modules in CS, because we need to add in the `many_to_many` or `one_to_many` associations.

It should be possible to abstract this out into this module, by using
`__MODULE__.__schema__(:associations)` to get all of the associations, then map through that with `__MODULE__.__schema__(:association, assoc)` to get detailed information on each association, including whether it's a `many_to_many`, `one_to_many` etc, then comparing it with the updated attributes and dealing with any updated associations in the appropriate way.

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.