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

Undoing a destroy Roster leaves the roster with no admin #169

Open
bandogora opened this issue Mar 16, 2021 · 2 comments
Open

Undoing a destroy Roster leaves the roster with no admin #169

bandogora opened this issue Mar 16, 2021 · 2 comments
Labels

Comments

@bandogora
Copy link
Collaborator

bandogora commented Mar 16, 2021

When you click the "undo" link after destroying a Roster the Roster is recreated from it's last version, but it's associations are not.
Memberships are destroyed when their Roster is:

has_many :memberships, dependent: :destroy

This means we loose the Membership that defines what User is an admin for that Roster. With no admin, no User is allowed to edit or destroy that Roster.

I see two possible ways of fixing this:

  • Saving association data with the Roster version and versioning Memberships.
  • Adding an admin column to Roster , this would require changing the association between Users and Rosters and probably removing the Membership class.
@bandogora bandogora added the bug label Mar 16, 2021
@werebus
Copy link
Member

werebus commented Mar 16, 2021

  • Don't bother allowing "undo" of roster deletion?

I dunno, this has the feeling of something that's going to be a big pain to unravel. And, practically speaking, no one has ever destroyed a roster in "real life".

@bandogora
Copy link
Collaborator Author

  • Don't bother allowing "undo" of roster deletion?

Yeah, that works too. I don't think it would be too hard to unravel. But I agree, adding a confirm to the "Destroy" button is probably good enough for rosters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants