Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close government / update ministers transactionally
Currently, it's possible for this method to close the government, and then run into trouble later on while closing ministerial appointments. If one of these `save!` calls failed, we'd be left in an inconsistent state. Wrapping the update and save! calls in a transaction will mean that they either all succeed, or are all rolled back, avoiding the chance of getting into this bad state. I also suspect (but am not 100% sure) that doing this transactionally will significantly speed up the code, because we won't have to open / close a transaction for every role appointment we save.
- Loading branch information