Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow inverse relationships to be added even when there is more than 1 with the same type #299

Merged
merged 2 commits into from
Apr 1, 2024

Conversation

tylerperyea
Copy link
Collaborator

This allows new relationships to be added on the inverted record when there are "variations" of the inverted relationship on the other side. The old restriction was mostly to prevent relationships entered without explicit "tracked" inversion (i.e. without originatorUUID set) from being overly duplicated. The scenario that used to happen was:

  1. A JSON dump with substances and their relationships to each other was produced
  2. Each appropriate relationship DID have an inverse, just not the tracking fields (originatorUUID)
  3. When registering / updating a relationship would try to add a NEW inverted copy to the other side of the record, even though it already existed but was just not tracked.

To prevent the third case the old code would look for an equivalent inverted form and prevent adding the inverse if it seemed it was already there. However this check only looked at the type and the related substances and didn't consider amount, qualification, etc. The new approach will still handle the above scenario but will only consider the inverse as already present if it matches on ALL fields that should be carried over.

@blueSwordfish blueSwordfish merged commit 6dad1a2 into master Apr 1, 2024
23 checks passed
@blueSwordfish blueSwordfish deleted the fixInverse branch September 17, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants