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

Add soft delete to LTI sections #54937

Merged
merged 4 commits into from
Nov 15, 2023
Merged

Conversation

carl-codeorg
Copy link
Contributor

Adds soft-delete to LTI sections. Adding the paranoid behavior messed up some of the cascading deletes, mostly because of the way that we were trying to get deleting a section to delete the LTI section, and vice versa. The only working solution I could find was:

  • removing the dependent: :destroy from the has_many :sections through: :lti_sections relationship in LTI Courses. Deleting the LTI course will delete the LTI section, which in turn will delete the section, so the additional destroy was redundant.
  • Removing the dependent: :destroy on both sides of the one-to-one relationship between sections and LTI sections. Instead, I added separate methods in each model to delete the corresponding other record. Without doing this, I ended up with endless loops when the two records tried to delete each other.

Links

Jira

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@carl-codeorg carl-codeorg marked this pull request as ready for review November 15, 2023 00:41
@carl-codeorg carl-codeorg requested a review from a team as a code owner November 15, 2023 00:41
@carl-codeorg carl-codeorg merged commit 5d092ff into staging Nov 15, 2023
2 checks passed
@carl-codeorg carl-codeorg deleted the p20-580/lti-section-paranoid branch November 15, 2023 19:59
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.

None yet

2 participants