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 associations and acts_as_paranoid #54188

Merged
merged 3 commits into from
Nov 15, 2023
Merged

Conversation

nicklathe
Copy link
Contributor

@nicklathe nicklathe commented Oct 12, 2023

This PR will be merged after the required migrations are completed. This PR does the following:

  • Adds has_many: associations for Users -> LTI User Identities LTI Integrations -> LTI Deployments, as well as dependent: :destroy. This set configures Active Record to delete these child resources when their parent is deleted.
  • Adds acts_as_paranoid to the LTI User Identity model, which offers soft deletion of records.
  • Adds method to delete attached LTI User Identities when the associated User is purged, as well as corresponding unit test

Links

This PR depends on the following migration PR to be merged first: #54266

Testing story

bundle exec spring testunit ./test/helpers/delete_accounts_helper_test.rb

  144/144: [=========================================================================================] 100% Time: 00:00:27, Time: 00:00:27

Finished in 29.42704s
144 tests, 830 assertions, 0 failures, 0 errors, 0 skips

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

@nicklathe nicklathe marked this pull request as ready for review October 17, 2023 16:06
@nicklathe nicklathe requested review from a team October 17, 2023 16:08
Copy link
Contributor

@carl-codeorg carl-codeorg left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Nick Lathe <nick.lathe@code.org>
  - Add logic and test to remove LTI User Identity instances when parent
    user is deleted
  - Remove acts_as_paranoid for LTI Integration and LTI Deployments models.
    This can be added later in separate PRs, as they require individual
    migrations
@nicklathe nicklathe force-pushed the P20-540/lti-associations branch 2 times, most recently from 3685e20 to f12b68d Compare November 14, 2023 23:38
@nicklathe nicklathe merged commit 05596c1 into staging Nov 15, 2023
2 checks passed
@nicklathe nicklathe deleted the P20-540/lti-associations branch November 15, 2023 18:10
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