Skip to content

Conversation

Zhao-Andy
Copy link
Contributor

@Zhao-Andy Zhao-Andy commented Jun 11, 2019

What type of PR is this? (check all applicable)

  • Bug Fix

Description

Fixes a minor bug where a user's organization memberships were not destroyed when the user was destroyed.

Related #3077

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Jun 11, 2019
it "destroys associated organization memberships" do
organization_membership = create(:organization_membership, user_id: user.id, organization_id: org.id)
user.destroy
expect { organization_membership.reload }.to raise_error ActiveRecord::RecordNotFound
Copy link
Contributor Author

@Zhao-Andy Zhao-Andy Jun 11, 2019

Choose a reason for hiding this comment

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

I had to use this workaround instead of organization_membership.persisted? since .persisted? kept returning true for some reason.

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Jun 11, 2019
@benhalpern benhalpern merged commit 9832d0c into forem:master Jun 11, 2019
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants