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

🐛 Exclude virtual tags from writing/updating #495

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

mansam
Copy link
Collaborator

@mansam mansam commented Sep 28, 2023

  • Add virtual field to TagRef
  • Ignore tag refs with virtual field set true when adding, updating, or replacing tags.
  • Fix bug preventing archetype tags being inherited properly
  • go fmt

@mansam mansam requested a review from jortel September 28, 2023 17:44
@mansam mansam changed the title Exclude virtual tags from writing/updating 🐛 Exclude virtual tags from writing/updating Sep 28, 2023
r.WithSourcedTags(archetypeTags, "archetype")
r.WithSourcedTags(resolver.AssessmentTags(), "assessment")
r.WithVirtualTags(archetypeTags, "archetype")
r.WithVirtualTags(resolver.AssessmentTags(), "assessment")
Copy link
Contributor

@jortel jortel Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to use new the const here ^^ and below vv?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did, thanks for pointing that out.

CriteriaTags []Tag `gorm:"many2many:ArchetypeCriteriaTags"`
Tags []Tag `gorm:"many2many:ArchetypeTags"`
CriteriaTags []Tag `gorm:"many2many:ArchetypeCriteriaTags;constraint:OnDelete:CASCADE"`
Tags []Tag `gorm:"many2many:ArchetypeTags;constraint:OnDelete:CASCADE"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this fixes archetype delete.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already exists on main so I'm not sure why it's showing up separately. I'll rebase my PR and clean it up.

Copy link
Contributor

@jortel jortel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
One comment re: usage of const.

* Add `virtual` field to TagRef
* Ignore tag refs with `virtual` field set true when
  adding, updating, or replacing tags.
* Fix bug preventing archetype tags being inherited properly
* go fmt

Signed-off-by: Sam Lucidi <[email protected]>
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