Skip to content

User account deletion with sole-owner guard#88

Merged
candyhazlett merged 2 commits into
mainfrom
user-account-deletion
May 18, 2026
Merged

User account deletion with sole-owner guard#88
candyhazlett merged 2 commits into
mainfrom
user-account-deletion

Conversation

@candyhazlett
Copy link
Copy Markdown
Contributor

Summary

  • Exposes Devise registrations#destroy by overriding it in Users::RegistrationsController
  • Blocks deletion and returns 422 if the user is the sole owner of any project, with a list of blocking projects in the response body
  • Adds dependent: :destroy to User#project_members so membership records are cleaned up on successful deletion
  • Covers all cases in spec/requests/users_spec.rb: unauthenticated redirect, clean deletion, membership cleanup, sole-owner block, and co-owner pass-through (18 examples, 0 failures)

Test plan

  • Sign in and DELETE /users — account is deleted and session cleared
  • Attempt deletion while sole owner of a project — expect 422 with error message and project list
  • Attempt deletion while co-owner (another owner exists) — account deletes successfully
  • Attempt deletion while unauthenticated — redirected to sign in
  • Verify ProjectMember records for the deleted user are removed

Overrides Devise registrations#destroy to block deletion when the user
is the sole owner of any project, returning 422 with a list of blocking
projects. Adds dependent: :destroy to User#project_members so membership
records are cleaned up on successful deletion.
…ore file filename collision

Bumps addressable (2.8.9 -> 2.9.0, CVE-2026-35611), net-imap (0.6.3 -> 0.6.4,
CVE-2026-42245/42246/42256/42257/42258), and view_component (4.5.0 -> 4.10.0,
CVE-2026-44836/44837). All are transitive dependencies.

Appends a loop index to Faker::Book.title in the dummy_data_generator rake task
so filenames within a collection are always distinct — prevents a flaky collision
that surfaced with the updated RNG sequence.
@candyhazlett candyhazlett merged commit 05a8935 into main May 18, 2026
4 checks passed
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.

1 participant