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

Check of there are any open revisions using a therapy/disease before deprecating it #1056

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

susannasiebert
Copy link
Contributor

Closes #1010

@susannasiebert susannasiebert added the enhancement PR Label for improvements to existing functionality. Will appear in release notes. label May 13, 2024
Copy link
Member

@acoffman acoffman left a comment

Choose a reason for hiding this comment

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

Looks good overall, couple of small nitpicks you can take or leave!

server/app/validators/deprecation_validator.rb Outdated Show resolved Hide resolved
end
revisions = Revision.where(field_name: entity_type_to_field_name(record), status: 'new').select{|r| Array(r.suggested_value).include?(record.id)}
Copy link
Member

Choose a reason for hiding this comment

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

This will pull every Revision to that field with a new status into memory which feels weird... but in practice its probably fine? There aren't that many at any given time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's not ideal but I'm not sure what would be the alternative.

server/app/validators/deprecation_validator.rb Outdated Show resolved Hide resolved
@acoffman acoffman merged commit fa9f378 into main Jun 5, 2024
4 checks passed
@acoffman acoffman deleted the deprecation_validator branch June 5, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PR Label for improvements to existing functionality. Will appear in release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvements to deprecated diseases and therapies
2 participants