Destroy related adherences for project on destroy
What does this MR do and why?
Destroy related adherences for project on destroy
-
Adhereneces have a not-null constraint on project_id hence they need to be destroyed along with the project explicitly.
-
This change was based off of: !174996 And avoids needing to change the DB in the same MR to make it easier to review and reduce potential impact.
-
Explicitly disabled
CodeReuse/ActiveRecord
to make use ofwhere
to avoid thedelete_all
for related adherences to trigger the not-null clause, when used through the project model. Wasn't able to fully determine the root cause of this distinction. The specs test for a the same query given and both calls pass this. I avoided going deeper into the error and opted for this pragmatism.
References
- Refs: #503968
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
- Create a group in ultimate plan
- Create project
- Add standards adherences to project
- Destroy group or just project