umts / screaming-dinosaur

A Rails app for the management of on-call schedules and interactions with Twilio.
https://umts-oncall.admin.umass.edu
MIT License
0 stars 2 forks source link

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

Open bandogora opened 3 years ago

bandogora commented 3 years ago

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: https://github.com/umts/screaming-dinosaur/blob/da4a878d10f7dfb518acb8303e39d33c96ddfd43/app/models/roster.rb#L6

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:

werebus commented 3 years ago

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 commented 3 years ago
  • 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.